Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, ozgur), 1,392 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
Is it possible to make a game with C/C++ only? #294389
10/18/09 20:49
10/18/09 20:49
Joined: Oct 2009
Posts: 33
A
AlexH Offline OP
Newbie
AlexH  Offline OP
Newbie
A

Joined: Oct 2009
Posts: 33
Hey, I understand the purpose of the lite-C language, and while I think it may help beginners, I don't need this sort of programming aid, and I don't think it really speeds up the prototyping process.

There are also other particulars I don't like about lite-C like the wait() function, and all the other special syntax keywords like action, event, ect.

So my question is, is it possible to make a game with the A7 engine in C/C++ only, that is to say without the lite-C language. If so, how would I go about this, are there any tutorials that start you off? Is there a manual or means for me to figure out how to access the engine the way that you would usually do with lite-C.

I appreciate the help.

Edit:
I'd also like to point out I have already read this tutorial on getting a basic entry point from C/C++.
http://portfolio.delinkx.com/files/GS.pdf

Update: I still am seeking information on how to write a game mainly in C++, would like to know stuff like, is it even possible?

Last edited by AlexH; 10/20/09 03:18.
Re: Is it possible to make a game with C/C++ only? [Re: AlexH] #294395
10/18/09 21:28
10/18/09 21:28
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
all functions are same with lite-c. you can use lite-c manual with c++.

but starting with lite-c and getting overall understanding of engine and function concepts and switching to c++ after that is a better path to follow imo. Lite-c is not a new language you need to learn from scratch, it's just c with automatic typecasting and pointer helping thing.


3333333333
Re: Is it possible to make a game with C/C++ only? [Re: Quad] #294401
10/18/09 22:11
10/18/09 22:11
Joined: Oct 2009
Posts: 33
A
AlexH Offline OP
Newbie
AlexH  Offline OP
Newbie
A

Joined: Oct 2009
Posts: 33
Ah, this explains a lot thanks.

I do understand that lite-C is really just an advanced C compiler that has a lot of A7 specific integration, however, I wanted to learn the engine without having to use the wait() function a lot in particular.

Apparently I have to use the wait() function quite often if I plan to make a game. Even for things as simple as animation. There are a few reasons I am against the wait() function, the main one being how unorganized the order of execution can get. So is there a set of callbacks, like a function or something that is called every frame that I can use to perform once-per-frame functionality, so that I can avoid using wait frequently if at all?

Last edited by AlexH; 10/18/09 22:12.
Re: Is it possible to make a game with C/C++ only? [Re: AlexH] #294404
10/18/09 22:26
10/18/09 22:26
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
well, just try to use it, it's not actually what you think it is.Well it'll become so natural that you wont even think that you are using it when you are typing the code.

when you create function with a infinite while loop and put wait(1); at the end of that while, that while will loop only once per frame. wait makes the loop wait for the next frame. and youll get one per frame functionality.wait doesnt make the whole functions to wait for the next frame, it only makes the function which is wait called from to wait.



about "action" keyword, it is actually "void" type.

acknex.h line 12: typedef void action;

only diffrence is that in wed, actions show up in behaviour list, and you can assign this funtions to your entities that you have placed in wed.

if you use and a while(1)...wait(1) loop in you actions(entity functions, whatever you want to call), you'll also get another function that runs once every frame. Then tehre is "my" pointer which refers to the entity which is currently calling that action.then you can use "my" in your action, which will point to the entity that is calling the action, and you can access all entity properties using my, point it to something else, pass it as a function paramter etc.

so when you write an action like
Code:
action braaagahahahaga(){
   while(1){
     my.pan+=10;
     wait(1); 
   }
}



and assign this to an entity in wed, and run your script, your entity will start to spin like crazy. and wont stop spinning.

Concep it very easy yet very powerfull.

Skim thru the workshops, and you'll find your self diving deep in the manual and prototyping you game in full speed.

Last edited by Quadraxas; 10/18/09 22:27.

3333333333
Re: Is it possible to make a game with C/C++ only? [Re: Quad] #294495
10/19/09 14:22
10/19/09 14:22
Joined: Oct 2009
Posts: 33
A
AlexH Offline OP
Newbie
AlexH  Offline OP
Newbie
A

Joined: Oct 2009
Posts: 33
Thanks Quadraxas, are you absolutely sure there's not a viable alternative to the wait() function?

I understand how to use it, but it really feels like its an unnecessary aspect of the engine, I would rather have a callback system.

I don't want to have 50 entities on screen all with wait(1) loops. If the looped functions get large enough there could be noticeable performance implications; that's 50 functions that have to be sent to the scheduler all with their own variables that have to be preserved ect.

I keep hearing "It's very powerful" and although in a sense that is true, I'd like to point out its a very inefficient alternative to engine callbacks, why not just give an entity things like onFrame, onCreate, onDestroy callbacks? I'm planning on adding this functionality myself.

So my question is, are there any engine callbacks that get called every frame that I could use to do entity based updates (like updating animations ect)?

Note: I've completed all the workshops and skimmed the manual


Last edited by AlexH; 10/19/09 14:24.
Re: Is it possible to make a game with C/C++ only? [Re: AlexH] #294497
10/19/09 14:39
10/19/09 14:39
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
yes there is on_frame event, which is called every frame, afaik you can use it in c++, and that's the alternative to wait.

http://www.conitec.net/beta/on_frame.htm

it's not beta, it's just the url that online manual is located.

edit: teher is also EVENT_FRAME flag, if you set this flag of an entity, it's event will be called onece every frame.

Last edited by Quadraxas; 10/19/09 14:44.

3333333333
Re: Is it possible to make a game with C/C++ only? [Re: Quad] #294521
10/19/09 17:07
10/19/09 17:07
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
Quoting AlexH.
Quote:
I don't want to have 50 entities on screen all with wait(1) loops.

(Can the same be done with 1 list of entities, 1 loop to iterate over that list, and 1 wait(1)?)

::Dumb rhetorical questions of limited relevancy can be thoroughly ignored.::

Re: Is it possible to make a game with C/C++ only? [Re: Quad] #294522
10/19/09 17:11
10/19/09 17:11
Joined: Oct 2009
Posts: 33
A
AlexH Offline OP
Newbie
AlexH  Offline OP
Newbie
A

Joined: Oct 2009
Posts: 33
Originally Posted By: Quadraxas
yes there is on_frame event, which is called every frame, afaik you can use it in c++, and that's the alternative to wait.

http://www.conitec.net/beta/on_frame.htm

it's not beta, it's just the url that online manual is located.

edit: teher is also EVENT_FRAME flag, if you set this flag of an entity, it's event will be called onece every frame.


Thanks I actually found this just before reading your reply, this is awesome grin no more wait!

Originally Posted By: testDummy

(Can the same be done with 1 list of entities, 1 loop to iterate over that list, and 1 wait(1)?)

Yes, however this would be the slower alternative to a simple on_frame function like above.

So do I still have to use lite-C? How would I implement things like actions and event callbacks from C++?

Last edited by AlexH; 10/19/09 17:15.
Re: Is it possible to make a game with C/C++ only? [Re: AlexH] #294557
10/19/09 20:59
10/19/09 20:59
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
Originally Posted By: AlexH
Yes, however this would be the slower alternative to a simple on_frame function like above.


how do you know?

Re: Is it possible to make a game with C/C++ only? [Re: Joey] #294587
10/20/09 03:16
10/20/09 03:16
Joined: Oct 2009
Posts: 33
A
AlexH Offline OP
Newbie
AlexH  Offline OP
Newbie
A

Joined: Oct 2009
Posts: 33
Originally Posted By: Joey
Originally Posted By: AlexH
Yes, however this would be the slower alternative to a simple on_frame function like above.


how do you know?


Because wait(1) would place the function on the scheduler, store local variables and other state-specific information, where on_frame is just a simple function call and does not involve the scheduler.

Could anyone please point me in the right direction to using C++ to write my game? I've written with C++ many times before and have developed a sort of work flow that is more close to a standardized development process, so that it is easier to work in a team oriented scenario. Not to mention C++ has classes and inheritance, which is really a beautiful thing and it sort of confuses me as to why it is not in lite-C already. When I started programming classes/structs are one of the first things you understand, I didn't really find them mind boggling.

I under stand lite-C is very similar to C++, but I don't understand how to use things like the c_trace function which sets a variable "target". How do I access this from C++? Or can I not do this?

Page 1 of 3 1 2 3

Moderated by  TWO 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1