Page 1 of 1

Standalone Game Template

PostPosted: Wed Oct 14, 2020 8:35 am
by Nash

This is a standalone IWAD (.ipk3) that contains the absolute bare minimum assets needed to cleanly start the engine with no errors or warnings.

- Contains a custom palette made by me from scratch - this palette is libre and you therefore won't run into any legal issues.
- Contains basic lumps, some basic textures and graphics, a basic player sprite, some basic ZScript classes and a simple test map.

Should be easy to modify - just do a search-and-replace for everything 'MyStandaloneGame' and 'My Standalone Game' and you're good to go.

The game starts with modern-style controls (WASD + mouselook) and unfiltered textures, while everything else is left to engine defaults. You are of course free to edit your game defaults as you please - just edit defbinds.lmp and defcvars.lmp.

TIP: Use Rachael's config converter utility to generate your game's defaults based off your personal config files! Generally, the procedure would be to load up your IWAD in a fresh installation of GZDoom/LZDoom, run the game, set the options to your heart's content, exit the game, rename the INI to 'gzdoom.ini', place the INI in the same folder as convert-config, then use convert-config like this:

Code: Select allExpand view
// Replace 'MyStandaloneGame' with the name of your custom game, defined in IWADINFO
convert-config MyStandaloneGame

Use this to quickly prototype a custom standalone game project for GZDoom.

You must start the game using the following command to properly load it as a custom game IWAD:

Code: Select allExpand view

.exe -iwad MyStandaloneGame.ipk3
lzdoom.exe -iwad MyStandaloneGame.ipk3

All assets, except the fonts, are created by me (Nash Muhandes) and are released under CC-0. For more details, read license.txt and credits.txt

Compatible with GZDoom 4.5.0 and LZDoom 3.87b.

Happy game making!

Wanna chat about my mods? Join my studio's Discord server, Mischief Donut!

I spend an uncountable amount of hours making mods. Consider supporting me on Patreon for cool benefits!

Re: Standalone Game Template

PostPosted: Wed Oct 14, 2020 9:19 am
by Caligari87
Ooo, bookmarking this. Thanks Nash!


Re: Standalone Game Template

PostPosted: Wed Oct 14, 2020 9:39 am
by Enjay
Potentially very useful. A lot of people ask "what's needed for a stand alone game" and the answer is now a link to this thread. :thumb:

Re: Standalone Game Template

PostPosted: Wed Oct 14, 2020 10:54 am
by Rachael
This is great! A basic "get-up-and-go" starter package with all the assets you need to get going immediately.

Re: Standalone Game Template

PostPosted: Wed Oct 14, 2020 9:54 pm
by Nash
I have been told that this does not start up on non-devbuilds. My mistake - looks like I was using some devbuild features.

For now, all you have to do is delete the included defbinds and defcvars lumps. You'll have to regenerate them using Rachael's config converter. I most like won't update the download in the OP because it'd be pointless to remove it now, then re-add it back when the next version of GZDoom comes out...

All fixed for GZDoom 4.5.0 and LZDoom 3.87b

Re: Standalone Game Template

PostPosted: Wed Oct 14, 2020 10:05 pm
by Rachael
It should always start on dev builds. If it doesn't that means it's a cvar we missed, please report it, that's rather urgent especially with an upcoming release.

Re: Standalone Game Template

PostPosted: Thu Oct 15, 2020 5:06 am
by Enjay
It's OK, it does start with the latest dev builds. It's the older builds and the last official GZDoom that it won't start with.

Re: Standalone Game Template

PostPosted: Thu Oct 15, 2020 6:22 am
by Rachael
Ah - yes, defcvars will not even start if you use a version more recent than its config version.

@ Nash: To fix this problem, you will have to start GZDoom on 4.4.2 first, using your current config, *then* run the config converter utility on the file that 4.4.2 produces.

Defcvars is designed to be backwards compatible, not forwards compatible.

The other thing you can do is bump the version number down by 1, and then remove the new CVARs from Defcvars one by one until it stops erroring out on startup.

Re: Standalone Game Template

PostPosted: Thu Oct 15, 2020 6:26 am
by Nash
Yes, the defcvars issue is already fixed on my end. However now I run into another problem (as you've seen me ask on Discord) - it seems LZDoom has no fallback fonts and will fail to start if no fonts are bundled into the IWAD. Looks like I'll have to be creating my own libre fonts (both smallfont and bigfont). This turned out to be more effort than I initially thought it'd take... >_<

Re: Standalone Game Template

PostPosted: Wed Jan 06, 2021 5:09 am
by Nash
Updated to version 1.1. Cleanly starts with no errors on both GZDoom 4.5.0 and LZDoom 3.87b. New sprites, textures and graphics.

Re: Standalone Game Template

PostPosted: Sat Mar 06, 2021 2:55 pm
by PowerUpT
I'm really glad I found this resource, because it's exactly what I need for a project! Unfortunately I'm running into a really weird issue, but not a major one now that I have identified what is happening partially.
The template was working fine, and I had barely begun trying some map editing and adding textures with it. Strangely, when I added some new textures to the ipk3 and loaded it into GZDoom (I am using the GZDoom version), it started prompting me for an iwad anyways even when I supply it one by dragging the iwad/ipk3 onto the executable, launching it with SLADE3 directly, or using a launch parameter on the command line. This leads to a launch error, that seems to be the source port freaking out about there being multiple player objects and huds loaded, due to the source port loading twice:
Code: Select allExpand view
MyStandaloneGame.ipk3:zscript/mystandalonegameplayer/mystandalonegameplayer.zc, line 1: Class name MyStandaloneGamePlayer already exists
MyStandaloneGame.ipk3:zscript/mystandalonegamehud/mystandalonegamehud.zc, line 1: Class name MyStandaloneGameHUD already exists
MyStandaloneGame.ipk3:zscript/mystandalonegameplayer/mystandalonegameplayer.zc, line 1: MyStandaloneGamePlayer already has defaults

This seems like a source port problem to me, but I'm putting it here because it only affects the template ipk3. Launching Doom 2 with a parameter also brings up the iwad prompt again, but it loads fine.

Could this be an issue with the template? I just want to ask before I put this issue on the GZDoom github. Thanks.