Best way to have a functional game on develop

Best way to have a functional game on develop

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
malric
Posts: 515
Joined: 30 Dec 2005, 22:22

Best way to have a functional game on develop

Post by malric » 17 Apr 2019, 23:58

I have followed https://springrts.com/wiki/Building_Spring_on_Linux to compile the engine (the develop branch as master is 2 years old), but now I would need a running game.

I got a map placed it in .config/spring/maps and zero-k git (https://github.com/ZeroK-RTS/Zero-K - mostly because this is what I play, no specific preference), placed it in .config/spring/games/zk.sdd. Started spring with no arguments (default menu), I can select both zk and the map but do not see the lua interface (log at https://pastebin.com/2pcpUqK5).

Ok, maybe need fancier start script. Tried to get chobby git (https://github.com/ZeroK-RTS/Chobby), placed it in .config/spring/games/chobby.sdd. Started with "spring --menu 'Chobby $VERSION'", do not see anything (log at https://pastebin.com/SL22cujd)

Questions:
- is there a simple way to get a game going? (like the commanders script from way back)
- am I doing something wrong with the above steps?
- are the wiki pages considered the main source of information for a newcomer? (I know you should look at the code, but help is still good). If yes, will add some comments here and there to prevent anybody to do same mistakes as me (ex: compile from master and wonder why it fails)
0 x

User avatar
Silentwings
Moderator
Posts: 3553
Joined: 25 Oct 2008, 00:23

Re: Best way to have a functional game on develop

Post by Silentwings » 18 Apr 2019, 00:06

This forum is maybe not the best place for info about running zk-dev but there it looks like you need the engine from the maintainence branch (instead of develop).
are the wiki pages considered the main source of information for a newcomer?
Yes, although there are also many people able to answer questions, or subprojects you can get involved in.
0 x

malric
Posts: 515
Joined: 30 Dec 2005, 22:22

Re: Best way to have a functional game on develop

Post by malric » 18 Apr 2019, 00:11

Maybe should I have been more explicit: I do not want to work with zero-k in particular, any game would do (something that have units).

FYI I want to play with the water level in the engine (so, a game with some water units would help, but can probably make water units if the thing starts).

What game is used to test the develop branch?
0 x

User avatar
Silentwings
Moderator
Posts: 3553
Joined: 25 Oct 2008, 00:23

Re: Best way to have a functional game on develop

Post by Silentwings » 18 Apr 2019, 00:16

Currently I think none, the develop branch is part way through a long & complex migration to a newer gl version. While that happens the newest engines used by live games are those on the maintainance branch.
0 x

malric
Posts: 515
Joined: 30 Dec 2005, 22:22

Re: Best way to have a functional game on develop

Post by malric » 18 Apr 2019, 09:25

Ok, so assume most lua will be affected by migration hence no gui and/or fancy unit control.

What I am doing now: start BA with simple script (ZK ships refused to fire, probably some lua thing), do "/cheat", do "/give armpship" (any simple way or pointer on how to automate these last 2 steps programmatically ?)
0 x

User avatar
Silentwings
Moderator
Posts: 3553
Joined: 25 Oct 2008, 00:23

Re: Best way to have a functional game on develop

Post by Silentwings » 18 Apr 2019, 09:45

any simple way or pointer on how to automate these last 2 steps programmatically
No, that's the usual way. You can press uparrow to "re-type" previous commands. A widget can bind them to a key (addon.KeyPress, Spring.SendCommands), but it doesn't save much.
0 x

malric
Posts: 515
Joined: 30 Dec 2005, 22:22

Re: Best way to have a functional game on develop

Post by malric » 20 Apr 2019, 14:11

For reference, for the game to start with one unit spawned at a position a widget with the following will do

Code: Select all

function widget:GameFrame(frame)
  if frame == 1 then
    Spring.SendCommands("Cheat")
  end
  if frame == 2 then
    Spring.SendCommands("Give armpship @600,100,3300")
  end
end
Did not work with Cheat and Give in the same frame.
0 x

Google_Frog
Moderator
Posts: 2424
Joined: 12 Oct 2007, 09:24

Re: Best way to have a functional game on develop

Post by Google_Frog » 22 Apr 2019, 04:11

You can't run most games on develop because of the graphics rewrite. Most non-engine things won't draw correctly, and there may be other related bugs.

If maintenance is fine, I run ZK on maintenance engines with a standalone ZK.
  • Put Zero-K.exe (the chobby wrapper) in an empty folder.
  • Run the wrapper to download and install the base game.
  • Clone chobby and zk to Games.
  • Run Zero-K.exe with 'dev 104.0.1-1156-gb72a9cc' to run dev chobby on the engine called '104.0.1-1156-gb72a9cc'.
The engines are downloaded from the ZK infrastructure, and only the versions that I have manually moved from https://springrts.com/dl/buildbot/default/maintenance/ exist. This is because the buildbot site deletes old builds too early for my purposes.

If you are building spring then you don't need to worry about downloading the engine. Simply pick one engine version and override it with your build. It can be found on windows in 'engine/win32/104.0.1-1156-gb72a9cc'. Make sure to not delete done.txt, as it tells the wrapper that the engine download was completed.

If you really want to run develop, then you're probably better off making a skeleton game with what you want.

The repository links and other information can be found here: http://zero-k.info/mediawiki/index.php? ... Developing
1 x

malric
Posts: 515
Joined: 30 Dec 2005, 22:22

Re: Best way to have a functional game on develop

Post by malric » 22 Apr 2019, 10:47

Thanks for the detailed answer. It clarifies some things.

Some additions to your observations (of course, when talking about heads branches things might be different when you read this):
  • most games will have problems on develop because the initialization of Lua will fail and hence interface and game actions (LuaRules) will exit abruptly. This will also prevent custom widgets execution.
  • another way to run zk on the springrts maintenance branch (instructions for Linux):
    • cloned both springrts maintenance branch and zk master
    • linked zk git to INSTALL_DIR/.config/spring/games
    • start spring once, got a script in INSTALL_DIR/.config/spring/_script.txt copied somewhere else (and added GameStartDelay=0 to Game section)
    • just run "spring script_copied.txt"
  • the skeleton game mentioned can be made from https://github.com/FLOZi/SpringABC - if you just need one/two units you can copy them from other games.
  • (looked out of curiosity, please correct me if I am wrong, anyhow I am on Linux and like building and running things) chobby.exe is built from https://github.com/ZeroK-RTS/Zero-K-Inf ... byLauncher
0 x

Post Reply

Return to “Engine”