Creating own game

A forum about everything related to the Cafu World Editor CaWE: mapping, editing, scripting, making GUIs and fonts, using the BSP, PVS and Light compilers.
Post Reply
User avatar
Haimi
Posts: 85
Joined: 2011-11-23, 09:28

Creating own game

Post by Haimi » 2012-01-14, 18:02

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?
Project Status: Code architecture definition
6 Programmers, 1 Photographer, 1 Architect, 1 Game designer
User avatar
Carsten
Site Admin
Posts: 2160
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Creating own game

Post by Carsten » 2012-01-15, 11:39

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?
Best regards,
Carsten
User avatar
Haimi
Posts: 85
Joined: 2011-11-23, 09:28

Re: Creating own game

Post by Haimi » 2012-01-15, 17:40

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 :)
Project Status: Code architecture definition
6 Programmers, 1 Photographer, 1 Architect, 1 Game designer
User avatar
Haimi
Posts: 85
Joined: 2011-11-23, 09:28

Re: Creating own game

Post by Haimi » 2012-01-15, 19:38

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?
Project Status: Code architecture definition
6 Programmers, 1 Photographer, 1 Architect, 1 Game designer
User avatar
Haimi
Posts: 85
Joined: 2011-11-23, 09:28

Re: Creating own game

Post by Haimi » 2012-01-15, 20:02

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.
Project Status: Code architecture definition
6 Programmers, 1 Photographer, 1 Architect, 1 Game designer
User avatar
Carsten
Site Admin
Posts: 2160
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Creating own game

Post by Carsten » 2012-01-16, 02:22

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:
Best regards,
Carsten
User avatar
Haimi
Posts: 85
Joined: 2011-11-23, 09:28

Re: Creating own game

Post by Haimi » 2012-01-16, 02:49

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.
Project Status: Code architecture definition
6 Programmers, 1 Photographer, 1 Architect, 1 Game designer
User avatar
Carsten
Site Admin
Posts: 2160
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Creating own game

Post by Carsten » 2012-01-18, 16:38

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...)
Best regards,
Carsten
User avatar
Haimi
Posts: 85
Joined: 2011-11-23, 09:28

Re: Creating own game

Post by Haimi » 2012-01-18, 17:20

Updated - works like a carm, at least on linux ^^
Project Status: Code architecture definition
6 Programmers, 1 Photographer, 1 Architect, 1 Game designer
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest