QB64.org Forum

Active Forums => Programs => Topic started by: pforpond on March 16, 2019, 12:05:12 pm

Title: adventure game engine
Post by: pforpond on March 16, 2019, 12:05:12 pm
Hey all :)

I'm rebuilding an old game engine of mine with some great improvements that can make it easier for people to quickly create content for it. I encourage anyone to have a play about with it. So far it should hopefully keep the player character within map boundaries and outside objects, no matter the size of the sprites or window resolution used. Also a new layer system that adds some depth to the world too, allowing the player character to walk behind objects.

Have a go at making some players, objects and maps of your own. Open the game prompt and change some values, go crazy. There kind of a manual in the .zip file attached that can help people tell what values are in which files if you're having trouble figuring out my awful code. :)  There is also a console (vameconsole.bas) that can help troubleshoot any issues you may be having.

There will be plenty more features coming soon :)

Put the data folder (in the zip file) in your QB64 folder.
Put the vameconsole executable in the data folder (if you wish to use the console).
Controls-
ARROWS - Move
\ - Open Prompt
I - Inventory
SPACE - Interact
Q - Quit

Latest Update (https://www.qb64.org/forum/index.php?topic=1159.msg113656#msg113656)
Title: Re: adventure game engine
Post by: Ashish on March 17, 2019, 05:35:08 am
Hi roadbloc! Good to see you...
Its nice! Are you planning for the next part of the game?
Title: Re: adventure game engine
Post by: pforpond on March 17, 2019, 10:55:50 am
Hi roadbloc! Good to see you...
Its nice! Are you planning for the next part of the game?

Hi Ashish! Good to see you’re still about :)
I’m planning on making a whole new game entirely... with cats! But my engine needs a massive tune up first.
Title: Re: adventure game engine
Post by: TempodiBasic on March 18, 2019, 08:50:08 am
Hi pforpond

fine engine, it must be put at work!

From your code I see you like LET keywords. !?
Does it LET to distinguish well between  assigment and comparison? Fine idea.
Title: Re: adventure game engine
Post by: pforpond on March 19, 2019, 04:41:21 am
Does it LET to distinguish well between  assigment and comparison? Fine idea.

That’s correct. Just makes it easier for me to tell what is going on in my code, though some people seem to dislike it for whatever reason. :)
Title: Re: adventure game engine
Post by: Jack002 on March 19, 2019, 10:55:28 am
Let is the appendix of Basic. It does no harm, it does not good. :)
Title: Re: adventure game engine
Post by: pforpond on March 20, 2019, 12:55:28 pm
Some new updates... tweaks to the object collision, support for invisible triggers and a new scripting feature. Both maps are linked with exits that demonstrate the invisible triggers and the scripting feature.
Title: Re: adventure game engine
Post by: TempodiBasic on March 20, 2019, 06:31:02 pm
Hi
last time I have missed two little feedbacks
1.  here
Quote
$EXEICON:'data\icon.ico'
I must add .\  to let to find icon in the right path

2. just after press F5 the window of the application is so small
but pressing the combokey of windows Alt+Enter I get fullscreen and now it is ok
Title: Re: adventure game engine
Post by: pforpond on March 21, 2019, 08:32:05 am
Hi
last time I have missed two little feedbacks
1.  here
Quote
$EXEICON:'data\icon.ico'
I must add .\  to let to find icon in the right path
Thank you for spotting this!

Quote
2. just after press F5 the window of the application is so small
but pressing the combokey of windows Alt+Enter I get fullscreen and now it is ok
The window is super small because of the small resolution images I'm currently using. The window should be resizable to your preferred size. Alternatively if you set the second value in /data/saves/savedata.ddf to 1, this will make the game launch in full screen mode by default. I will be adding an option in the main menu to toggle windowed/fullscreen modes in a future update. :)
Title: Re: adventure game engine
Post by: TempodiBasic on March 22, 2019, 04:30:28 pm
thanks
Title: Re: adventure game engine
Post by: qb4ever on March 24, 2019, 06:06:18 am
Hi pforpond,

interesting engine !

Congratulations.
Title: Re: adventure game engine
Post by: pforpond on April 04, 2019, 06:00:22 am
Hi pforpond,

interesting engine !

Congratulations.
Thank you! I hope it continues to get even more interesting for you! :)

I have a new build here. It comes with bug fixes, music and sound effect support, a slightly updated main menu and more commands added to the script feature. I've also added a demo script to showcase some of the new features, just press '#' whilst in game and type in 'script demo' (the demo will loop indefinitely, just close the game and relaunch to stop it).

Hopefully in the next update I'll have some NPCs roaming around the maps x
Title: Re: adventure game engine
Post by: pforpond on July 27, 2019, 02:22:01 am
New update!

Now with basic NPC support. NPCs now wander map2, complete with object collision. Sorry for the wait x

All feedback is much appreciated :)
Title: Re: adventure game engine
Post by: SierraKen on July 27, 2019, 12:54:29 pm
Pretty cool! Someone can make this into a great game.
Do you still use the REM command? That's an old 80's command which was replaced in QBasic and later QB64 with just using ' in front of the worlds. For example:

' This is a remark about the game.

It uses 2 bits of less memory I think, so not much help but it does give less to read in the code. For future programs you make if you want.
Title: Re: adventure game engine
Post by: pforpond on July 28, 2019, 05:16:54 am
Pretty cool! Someone can make this into a great game.
Thanks! I plan to make a game of this someday myself, though anyone is welcome to pay around with my engine themselves for their own stuff :)
I did once make an attempt to make a game from a previous and kinda similar engine of mine, but regretfully I found it too restrictive and difficult to use, so now I'm rebuilding it with many improvements. If you're interested you can check out the game here (https://roadbloc.itch.io/the-mystery-of-robot-planet) it should give you an idea of where I'm taking the engine.

Quote
Do you still use the REM command? That's an old 80's command which was replaced in QBasic and later QB64 with just using ' in front of the worlds. For example:

' This is a remark about the game.

It uses 2 bits of less memory I think, so not much help but it does give less to read in the code. For future programs you make if you want.
I still use REM because I prefer it I guess, makes my comments more visible to me. I use the ' to temporary blank lines out of my code as needed. You may have noticed I still use LET too... I just feel more comfortable using them. :)
Title: Re: adventure game engine
Post by: TempodiBasic on July 28, 2019, 11:15:00 am
Hi
fine evolution!
It has like feature also automatic path...
the user character, after going out from the first room (so in the second room), going on the door locked (it is on the top right of the room) it goes automatically to the centre of the room! Moreover if it goes onto the carpet of the Right Top wall it returns to the centre of the first room!
The .PDF file is very descriptive!
Title: Re: adventure game engine
Post by: pforpond on July 28, 2019, 02:10:54 pm
Hi
fine evolution!
It has like feature also automatic path...
the user character, after going out from the first room (so in the second room), going on the door locked (it is on the top right of the room) it goes automatically to the centre of the room! Moreover if it goes onto the carpet of the Right Top wall it returns to the centre of the first room!
The .PDF file is very descriptive!
Thank you :)
It sounds like you're describing the scripting feature, i should have it to be able to control the NPC's from their default routes in the next update no doubt. Take a look in any of the files in data/scripts if you're interested in seeing how it works :)
Title: Re: adventure game engine
Post by: pforpond on August 11, 2019, 05:34:56 am
Update 13


Controls- Arrow Keys = Move. I = Inventory. \ = Open Console. Q = Back/Quit.

Remember to compile vameconsole and put the executable in the data folder if you wish to use the developer console. :)
Title: Re: adventure game engine
Post by: pforpond on September 22, 2019, 10:43:09 am
Update 15


Next update will focus on further expanding script functionality and sound effect integration. All feedback welcome :)
Title: Re: adventure game engine
Post by: pforpond on December 29, 2019, 03:59:50 pm
Update 20!

Lots of new features and (finally!) a small demo game to play that showcases all the features the engine has to offer. A couple of known bugs you should be aware of first-

Extract the data folder and put it in your QB64 folder. Compile vame25.bas.
All feedback welcome :)
Title: Re: adventure game engine
Post by: TempodiBasic on December 29, 2019, 06:44:19 pm
just very fine!
Title: Re: adventure game engine
Post by: Petr on December 30, 2019, 11:25:06 am
Hi,

I don't know if i be live to the end of the compilation, the EXE file is still not created in about 5 minutes....
After 6 minutes i stop it and compile in version 1.2, its faster. Nice work!

I try compiling again in QB1.3 (last official version). Compiling start in 17:47:20.  Now is 18:01 and still is not done!
Title: Re: adventure game engine
Post by: pforpond on January 02, 2020, 05:36:36 am
Hi,

I don't know if i be live to the end of the compilation, the EXE file is still not created in about 5 minutes....
After 6 minutes i stop it and compile in version 1.2, its faster. Nice work!

I try compiling again in QB1.3 (last official version). Compiling start in 17:47:20.  Now is 18:01 and still is not done!

Wow! I mean, its a bit of big program to compile but it shouldn't take that long! Maybe this is an issue with QB64?
Title: Re: adventure game engine
Post by: pforpond on January 09, 2020, 08:34:46 am
Update 21!

This update has bug fixes for Linux machines, removes any visible flicker and a new updater feature that can seek out a new update and download and install it automatically. A test update is live as a demonstration. The check for updates feature can be found in extra options. :)

Because it seems that it is taking some users a while to compile the code, I've uploaded a full download that includes all source code and executables.

Title: Re: adventure game engine
Post by: pforpond on January 27, 2020, 06:35:26 am
Update 24!

Probably the final version for now. Lots of polish bug fixes, tweaks and a handful of new features. Here are just a few of the changes-

Download available here! (https://www.dropbox.com/s/vip38ayqttlzgz2/VaME20200127.zip?dl=0) This zip folder contains the following-

If you already have a previous version on your computer and it has the 'check for updates' option in 'extra options' then you can just run that to automatically download and install the latest version whilst keeping your save and settings.

All feedback welcome! Have a wonderful day! :D :D :D
Title: Re: adventure game engine
Post by: Davor on January 27, 2020, 03:00:08 pm
Is Windows executable 64-bit?
I am using 32-bit Windows 10 and get "This App Can't Run on Your PC" error message.

Tried compiling from source with QB64 v1.4 but it failed after few minutes with message:
cc1plus.exe: out of memory allocating 65536 bytes.
Probably also because of limited memory space in 32-bit Windows.
Title: Re: adventure game engine
Post by: pforpond on January 28, 2020, 03:26:24 am
Is Windows executable 64-bit?
I am using 32-bit Windows 10 and get "This App Can't Run on Your PC" error message.

Tried compiling from source with QB64 v1.4 but it failed after few minutes with message:
cc1plus.exe: out of memory allocating 65536 bytes.
Probably also because of limited memory space in 32-bit Windows.

Yes the executable is 64 bit. I've had a few attempts at creating a 32 bit version but I get the same error no matter what I try. I've tried compiling a 32 bit version on both Windows XP (32 bit) and Windows 7 (64 bit) using QB64 versions 1.2, 1.3 and 1.4 and had no luck.

I'm very sorry but it doesn't look like I can make you a 32 bit build which is a shame :(
Title: Re: adventure game engine
Post by: SMcNeill on January 28, 2020, 03:57:41 am
Yes the executable is 64 bit. I've had a few attempts at creating a 32 bit version but I get the same error no matter what I try. I've tried compiling a 32 bit version on both Windows XP (32 bit) and Windows 7 (64 bit) using QB64 versions 1.2, 1.3 and 1.4 and had no luck.

I'm very sorry but it doesn't look like I can make you a 32 bit build which is a shame :(

I was curious about why this code wouldn't compile in 32-bit, while it works in 64-bit versions, so I downloaded the source and took a few moments and looked at it.  The issue is rather glaring, once one looks for just a bit:

Code: [Select]
    IF temp58 = 1 THEN _FREEIMAGE pocketsprite1
    IF temp58 = 2 THEN _FREEIMAGE pocketsprite2
    IF temp58 = 3 THEN _FREEIMAGE pocketsprite3
    IF temp58 = 4 THEN _FREEIMAGE pocketsprite4
    IF temp58 = 5 THEN _FREEIMAGE pocketsprite5
    IF temp58 = 6 THEN _FREEIMAGE pocketsprite6
    IF temp58 = 7 THEN _FREEIMAGE pocketsprite7
    IF temp58 = 8 THEN _FREEIMAGE pocketsprite8
    IF temp58 = 9 THEN _FREEIMAGE pocketsprite9

The source is copy/paste code with a lot of redundancy in it, and each of these lines end up translating into multiple lines of c-code... The end result ends up simply giving us more lines than what 32-bit cpp will work with.

If you want the code to work on 32-bit systems, I'd suggest that you swap over to array usage rather than copy/paste code.

Instead of a hundred lines of IF statements, all you'd need is one:  IF temp58 <> 0 THEN _FREEIMAGE pocketsprite(temp58)
   
Title: Re: adventure game engine
Post by: pforpond on January 28, 2020, 04:18:16 am
Instead of a hundred lines of IF statements, all you'd need is one:  IF temp58 <> 0 THEN _FREEIMAGE pocketsprite(temp58)

ooo fab! I always figured there was a better way but never actually got round to looking it up or figuring it out. Thank you for pointing me in the right direction with this :)

Davor- I'll do my best to have a working 32 bit version for you. Looks like Update 24 won't be the final one after all :D
Title: Re: adventure game engine
Post by: pforpond on January 28, 2020, 04:18:45 am
(my post duplicated for some reason?)