Page 1 of 1

Creating own game

Posted: 2012-01-14, 18:02
by Haimi
Hi there,

I am trying for two days to create my own game. I did this by forking the DeathMatch folder, replacing every path that points at "DeathMatch" and using the newly created Configuration option. The Problem: The Configurations does not stay at mine, it reverts every time I change it automatically.
Also, there must be something hard coded or something like that, because when I rename the DeathMatch Folder, I cannot even compile my maps.
Do you have any ideas?

Re: Creating own game

Posted: 2012-01-15, 11:39
by Carsten
Hi Haimi,
Haimi wrote:I am trying for two days to create my own game. I did this by forking the DeathMatch folder, replacing every path that points at "DeathMatch"
What you did was probably right, but which paths do you mean? In which files?
and using the newly created Configuration option. The Problem: The Configurations does not stay at mine, it reverts every time I change it automatically.
I just tried the following to see if I can find a problem:
  • copy "DeathMatch" to "NewGame",
  • start CaWE,
  • the "Configure" dialog also lists "NewGame" among the game configurations, where I can make changes e.g. to the default entities, default texture entities, etc.
  • click "OK", then quit and restart CaWE,
  • open the "Configure" dialog again and select "NewGame" as the configuration,
  • the settings are the same as set in the step above.
When I then pick "New Map" from the menu, it asks which game config the new map is for, selecting my custom "NewGame" seems to open a new map for the NewGame properly.
Also, there must be something hard coded or something like that, because when I rename the DeathMatch Folder, I cannot even compile my maps.
Do you have any ideas?
How do you compile the maps? Via the menu or manually via the command line?
What happens when you try?

Re: Creating own game

Posted: 2012-01-15, 17:40
by Haimi
Carsten wrote:
Haimi wrote:I am trying for two days to create my own game. I did this by forking the DeathMatch folder, replacing every path that points at "DeathMatch"
What you did was probably right, but which paths do you mean? In which files?
I copied the DeathMatch folder, naming it obg, then i searched the whole directory for Files containing "/DeathMatch" and replaced it by "/obg" to have a complete independent copy of the DeathMatch Game, so every map, Texture etc. is now found in the obg Folder.
Carsten wrote:
Haimi wrote:and using the newly created Configuration option. The Problem: The Configurations does not stay at mine, it reverts every time I change it automatically.
I just tried the following to see if I can find a problem:
...
Okay, I understand this one now, I thought the configure-dialog sets parametes for the current "workspace". I thought that, because when I start a map even linked to the obg configuration, the engine starts with the DeathMatch game.
Carsten wrote:
Haimi wrote:Also, there must be something hard coded or something like that, because when I rename the DeathMatch Folder, I cannot even compile my maps.
Do you have any ideas?
How do you compile the maps? Via the menu or manually via the command line?
What happens when you try?
So, i found out that my maps are compied right, but the wrong game is started, from the compile dialog aswell as froom console:

Code: Select all

Cafu $ build/linux2/g++/release/Ca3DE/Cafu Games/obg/Worlds/ObgMain.cw 
Cafu Engine, Jan 12 2012
config.lua processed.
Warning: Failed to open ZIP archive Games/DeathMatch/Textures/TechDemo.zip
Registering archive "Games/DeathMatch/Textures/SkyDomes.zip".
So it tries to access the DeathMatch game for those zip-archives.

How can I tell the engine which game to run? It seems it is always the DeathMatch Game - this seems to be the only problem :)

Re: Creating own game

Posted: 2012-01-15, 19:38
by Haimi
Another hours of trying, i found the Cafu parameters, calling this command:

Code: Select all

Cafu $ build/linux2/g++/release/Ca3DE/Cafu -svGame obg -svWorld "ObgMain"
resulting in error:
St13runtime_error
Could not load game obg.
With console output:

Code: Select all

Could not load the game DLL at  Games/obg/Code/build/linux2/g++/release/libobg.so
Do I have to change something else here?
Do I have to compile the main code by Hand?

Re: Creating own game

Posted: 2012-01-15, 20:02
by Haimi
Okay, now I've found out. It is only possible from console as I see...
There are some steps required to run the own game:
  • Go into SConstruct and create a section for the own game
  • Rename the DeathMatch.cpp file in Games/GameName/Code do GameName.cpp
  • Replace every Path in Games/GameName from DeathMatch to GameName
  • compile your maps without "5. Start Engine"
  • Start your map with following command:

Code: Select all

Cafu $ /path/to/Cafu -svGame GameName -svWorld "WorldName"
I can port this into the Wiki if it helps.

Re: Creating own game

Posted: 2012-01-16, 02:22
by Carsten
Hi Haimi,

many thanks for testing this, your wiki details, and for your feed-back!

I think that the editor should be able to properly run "5. Start Engine", and that the Sconstruct file should be able to compile all games automatically.
This would simplify "forking" the DeathMatch game a lot, as well as the related instructions in the Wiki.

Could you please file a ticket for each?
I already have some ideas how these things can be fixed... :up:

Re: Creating own game

Posted: 2012-01-16, 02:49
by Haimi
Hi Carsten,
so I made 3 Tickets out of what I thought on this case. Hopefully I can get into CaFU a little quicker in my College-free-time in three weeks and explore cafu a little more. I like the project and I'd love to contribute more.

Re: Creating own game

Posted: 2012-01-18, 16:38
by Carsten
Hi Haimi,

thanks for filing the tickets!
I looked into them in the meanwhile, and made some updates that - as I hope - fix the problems and generally help with forking a new game from DeathMatch.

Can you please test if the fixes were actually helpful?
Are there any other major or minor problems when "forking" a new game from DeathMatch?
(It would be great if "forking" was (almost) as simple as copying the directory...)

Re: Creating own game

Posted: 2012-01-18, 17:20
by Haimi
Updated - works like a carm, at least on linux ^^