Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Understand how game works #896

Closed
amit2103 opened this issue Sep 9, 2015 · 4 comments
Closed

Understand how game works #896

amit2103 opened this issue Sep 9, 2015 · 4 comments

Comments

@amit2103
Copy link

amit2103 commented Sep 9, 2015

This is a noob question. I will be extremely grateful if someone explains this though or simply points to doc.

I understand CorsixTH has a C++ and LUA part. C++ contains the core engine, whereas Lua contains the game logic. I want to know how does the LUA code parse a level? Lets say I create a .level file. Now the .level file seems to me to contain what are the things that should be created. How is the game flow determined? Which files in the actual TH are needed to do so?

@Alberth289346
Copy link
Contributor

Esentially, you're asking about the overall game structure, I think.
https://en.wikipedia.org/wiki/Game_programming#Game_structure seems like a first shot. If you explain why you want this information, maybe we can help you further.

As for the TH files, we don't use any code from them, just the graphics and some data files are used.

@amit2103
Copy link
Author

amit2103 commented Sep 9, 2015

@Alberth289346 Many thanks for the reply. I understand things like game loop. Essentially I want to build a game. I wanted to avoid using any engine and build one from scratch. I was going through some open source projects, I found the CorsixTH code easiest to understand (also TH used to be one of my all time favorite games) . I am having a hard time understanding how are the levels defined for CorsixTH. The .level file seems to contain some information but how is the data for level 1 and the flow different from that of the level 2. Is this mentioned in code or is it somehow rendered by the system generically from the config files?

@Alberth289346
Copy link
Contributor

A better place to discuss game programming in general is at a game programming forum like gamedev.net . If you want to program CorsixTH, just start, the code is right here in this project, it's usually easiest if you hang out in the #corsix-th IRC channel, where you can discuss things. You can also use the google newsgroup if you like. Some lua developers just communicate through issues here, but that is complicated, as issues are not really a discussion medium.

In the game loop, some code is running along that performs, eg emergencies, or earthquakes. When the level file is loaded, that code is set up to let those events happen at the time defined by the level file. If the level file does not contain eg emergencies, the 'emergency event' code is set up to never trigger.

@amit2103
Copy link
Author

Went through the code...after your comment...Got a better idea...Will try to take up some beginner level work, so that I can contribute more.

Many thanks for the replies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants