[ZScript] Side Scroller Game Starter Kit

Post your example zscripts/ACS scripts/etc here.

[ZScript] Side Scroller Game Starter Kit

Postby Nash » Sun Feb 26, 2017 12:27 pm

Image




Requires GZDoom g2.4pre-820-ge5a3d22 or later

Consider this beta quality! An official 1.0 release will be released alongside the next official version of GZDoom (should be around March 2017)


Inspired by the basic game kits that come with Unreal Engine 4... I give you the first game kit of its kind released for the ZDoom community. Side Scroller Game Starter Kit!

Features:

- Fully written in ZScript. No KEYCONFs, no cringe-worthy ACS. It Just Works.
- Smooth scrolling, uncapped framerate camera
- Animation framework - standing still, walking, jumping, etc. Easy to expand to fit your needs
- No need to tell your players to setup custom key bindings - uses default control scheme for movement
- Movement is completely customizable (just alter MoveSideScrollerPlayer as you please!)

I'm short on time right now and don't have time to make a more user-friendly documentation of the API or some kind of programming guide, but I think I've commented the stuff well enough so if you have a use for this kit; you probably won't have trouble navigating my code.

I tried to make my code as clean as possible. There are no errors or warnings in the console during startup.

This is a barebones game kit. You are expected to take this and build your game on top of it. If something is missing, you are probably going to have to do it yourself. :P Things like double-jumping, wall-jumping, more animations, attacking, crouching, monster AI etc... I purposely left them out. It's easy to expand the engine to do whatever you want. Have fun!

Hopefully this will spark more interest in ZScript and perhaps pave way for more game starter kits!

Bugs/Oversights I'm Aware Of (will fix next release)
- None so far

8 March 2017 update:

- Added ZScript versioning compatibility (requires GZDoom g2.4pre-820-ge5a3d22 now)
- Added player acceleration and deceleration to control the tightness of the player movement.
- Added dynamic jump height. Hold the jump key to jump higher. Tap the jump key to do short jumps.
- Added crouching.
- Fixed infinitely-jumping bug.
- Made demo map a little bigger.

The player movement properties can be customized in zscript/SideScrollerGame.zsc

Notice: I will no longer upload attachments to the forum, to conserve web space. To grab the latest version of the SDK, just go to the Github page, click the large green button that says "Clone or download", then "Download ZIP".

GitHub Repository
Last edited by Nash on Wed Mar 08, 2017 8:51 am, edited 9 times in total.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Side Scroller Game Starter Kit

Postby AFADoomer » Sun Feb 26, 2017 12:53 pm

Very nice! I remember the pain of making something like this work with ACS once upon a time...

One note: Do you have cl_capfps set? With uncapped framerate, I get a lot of player sprite flickering when moving...
User avatar
AFADoomer
 
Joined: 15 Jul 2003

Re: [ZScript] Side Scroller Game Starter Kit

Postby Nash » Sun Feb 26, 2017 12:57 pm

To all: I forgot an important piece of code to destroy the camera when the level ends... I saw about 5 downloads earlier. So please re-download. Sorry for the inconvenience!

AFADoomer: No, my framerate is uncapped. You can see in the video that it's running at 60 FPS with no sprite flickering and very smooth camera movement, as well as player movement. I'm not sure why you are getting such problems?
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Side Scroller Game Starter Kit

Postby Death Egg » Sun Feb 26, 2017 1:34 pm

Oh, fuck. I've been waiting almost a decade for something like this, thank you!
User avatar
Death Egg
 
Joined: 14 Aug 2012

Re: [ZScript] Side Scroller Game Starter Kit

Postby Nash » Sun Feb 26, 2017 1:52 pm

If anyone other than AFADoomer is also getting flickering player sprites, please let me know. It doesn't happen for me and now I'm a little worried.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Side Scroller Game Starter Kit

Postby GENTEK » Sun Feb 26, 2017 2:04 pm

Wow! Nice stuff Nash like always! :D I can imagine old console games revived with new effects & levels! 8-)
On my side all works like a charm! :wink:
GENTEK
 
Joined: 05 Aug 2013

Re: [ZScript] Side Scroller Game Starter Kit

Postby YukiHerz » Sun Feb 26, 2017 3:04 pm

This will help me a lot, thanks Nash!
User avatar
YukiHerz
Expensive pasta dude
 
Joined: 02 Dec 2013
Location: Where corruption is redefined daily.
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: Intel (Legacy GZDoom)

Re: [ZScript] Side Scroller Game Starter Kit

Postby AFADoomer » Sun Feb 26, 2017 4:05 pm

Nash wrote:If anyone other than AFADoomer is also getting flickering player sprites, please let me know. It doesn't happen for me and now I'm a little worried.

OK, did some more testing, and it only happens at resolutions over ~1600x900... So it may be a problem on my end - I've just never had issues with anything like this before, and I usually run at 1920x1440.
User avatar
AFADoomer
 
Joined: 15 Jul 2003

Re: [ZScript] Side Scroller Game Starter Kit

Postby Nash » Sun Feb 26, 2017 4:19 pm

Hmm that's odd. I ran the game with 1920x1200, and also 1920x1080, in full screen mode (the latter was what I used to record the video with FRAPS), no flickering...
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Side Scroller Game Starter Kit

Postby AFADoomer » Sun Feb 26, 2017 5:05 pm

Nash wrote:Hmm that's odd. I ran the game with 1920x1200, and also 1920x1080, in full screen mode (the latter was what I used to record the video with FRAPS), no flickering...


I think the problem's on my end somewhere... I'm seeing now that I get the same problem with the standard chasecam, it's just less noticeable.
User avatar
AFADoomer
 
Joined: 15 Jul 2003

Re: [ZScript] Side Scroller Game Starter Kit

Postby Nash » Sun Feb 26, 2017 7:19 pm

Could it be a graphics hardware or driver-related issue? You'd best get your stuff checked. :O
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Side Scroller Game Starter Kit

Postby protox » Sun Feb 26, 2017 8:10 pm

Awesome work, thanks!
User avatar
protox
 
Joined: 22 Mar 2014

Re: [ZScript] Side Scroller Game Starter Kit

Postby Enjay » Mon Feb 27, 2017 2:17 pm

No flickering here. Frame rate not capped and 1920x1200. Works very nicely.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: [ZScript] Side Scroller Game Starter Kit

Postby Hellstorm Archon » Mon Feb 27, 2017 9:43 pm

Aw yiss

Now I can finally see about making a Doom-styled Metroidvania I've always wanted to make (just as soon as I learn ZScript). :)
User avatar
Hellstorm Archon
Will debase self for street cred.
 
Joined: 24 Oct 2010
Location: 404 Error- Location of User Not Found
Discord: Man of Doom#4046

Re: [ZScript] Side Scroller Game Starter Kit

Postby YukiHerz » Sat Mar 04, 2017 10:00 pm

I know this isn't even the 1.0 release and this is something you already know about yourself, but posting just in case, if you spam the jump button/press it at the right time, you can continuously jump mid-air.
User avatar
YukiHerz
Expensive pasta dude
 
Joined: 02 Dec 2013
Location: Where corruption is redefined daily.
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: Intel (Legacy GZDoom)

Next

Return to Script Library

Who is online

Users browsing this forum: No registered users and 1 guest