Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : Drod's basic structure
New Topic New Poll Post Reply
Poster Message
seranko
Level: Roachling
Rank Points: 10
Registered: 11-03-2003
IP: Logged
icon Drod's basic structure (0)  
Hi

I am trying to write a new drod game engine as a project. I downloaded the code and started reading it, but I can't figure out what starts the whole thing - what exacly calls all the events.

I will be very thankful if you can explain the basics of the engine, in a little more detail than the "Explanation of DROD CVS Repository".

Thanks in advance

Eran
11-03-2003 at 04:04 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: Drod's basic structure (0)  
Execution starts in main() (main.c of DROD project). After some initialization is performed the screen manager is called to activate a screen. Each screen has its own set of event notification methods that are called while it is active. The code for receiving events and call event notifiers is in CEventHandlerWidget, but if you understand the events, it isn't really necessary to delve deeply into event-handling code. Events are mostly self-explanatory, mouse clicks, key presses, etc. See comments in eventhandlerwidget.h about specific events.

The screens also contain widgets. Widgets are things like list boxes, buttons, scroll bars, and other UI elements. The display of the DROD room is also encapsulated inside of a CRoomWidget.

Player commands are received via CGameScreen :: OnKeyDown() and sent to an instance of CCurrentGame. CRoomWidget gets information about the room from CCurrentGame and draws the room. This is just the user interface of the game. The game logic itself is all contained in CCurrentGame, with a very clean division from UI code. You won't find any code in CCurrentGame to update the screen or play sounds. CCurrentGame only concerns itself with updating the logical representation of the room in response to player commands. Because CCurrentGame cannot handle UI tasks, it passes a CCueEventList with descriptions of events that occured. The UI code decides if it needs to show a blood splatter animation, play the level complete sample, or whatever.

That's an overview. Ask about anything else you'd like to know.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
11-03-2003 at 04:49 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : Drod's basic structure
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.