Genus Prime - 8-BIT WARS competition entry

Started by Derron, April 01, 2019, 08:51:53

Previous topic - Next topic

Xerra

Just to clarify, I built the game with debug mode as a gui app for 64 bit Mac. I ran the created application and it had the same problem as previous versions where it would crash out 15 seconds or so after starting the first level.

However, when I built and run the game from within NG then it did run without that issue and I played the game for half an hour or so without crashing. I have no idea why this happens but I wanted to make sure you're aware as you seemed to be thinking it was the other way round.
M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

Xerra

Also, what I should add, is that I really like the game. I'm rubbish at it but I think it's a very good entry for this competition. I've had a go at most of the games now and it's definitely one of my favourites. I reckon it will do well in the voting.
M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

Derron

Could you try to run it from within a terminal? Might be an SDL issue then.

- open a terminal
- cd path/to/GenusPrime
- ./GenusPrime (or ./GenusPrime.app - dunno how it is named).


bye
Ron

iWasAdam

nope it crashes after about 4-5 seconds of play.  :o

crash happens at
tree_successor
bmx_map_intmap_hasnext
_brl_map_intmap_TIntNodeEnumerator_HasNext
TSpace_Update

So it looks like there is an error (possible with a null object), something to do with TMap?

Derron

That helps a lot ...
it's a "concurrent modification" - I iterate over ships and remove parts of them during the iteration (if they landed on something).

A first check if that fixes the issue (I would provide a more performant one):

Open up "GenusPrime.bmx":
Ctrl+F to find "Type TSpace"
Ctrl+F to find "Method Update"

And replace it with:

Method Update:Int()
For Local star:TBackgroundStar = EachIn backgroundStars
star.Update()
Next


For Local missile:TMissile = EachIn missiles.Copy().Values()
missile.Update()
Next


For Local ship:TShip = EachIn ships.Copy().Values()
ship.Update()
Next



'ACHTUNG: eventuell Updates "randomisieren", damit jeder Planet
'         mal zuerst dran kommt (angegriffen wird, produziert,...)
For Local planet:TPlanet = EachIn planets
planet.Update()
Next
End Method


Then it would create a copy of the whole map in each loop (not performant for now but as said the most simple fix).
I will try to shape of some sparetime this morning/lunchtime and and upload a new version then.

bye
Ron

Derron

If the previously mentioned "simple fix" works: I updated the code at github to do a better performing fix until I get a reply to the opened issue at github (Hope for Brucey or HurryStarfish ;-)).


Four options to update:
- checkout the git repo again
- update your local repo (if you cloned ....)
- manually insert the patch: https://github.com/GWRon/GenusPrime/commit/6bba1d8f864922d1458342eb679787e96d4a33a5
- download and override the GenusPrime.bmx: https://raw.githubusercontent.com/GWRon/GenusPrime/master/GenusPrime.bmx


I hope it works and fixes the issue. I meanwhile will compile the game again on my old Mac - and am excited to see if it works then for you too (with my old XCode etc).
Still does not explain why it should work when executed from within MaxIDE and not when "double clicked".

bye
Ron

3DzForMe

Awesome gameplay Derron, love the associated sound as well.

BLitz3D, IDEal, AGK Studio, BMax, Java Code, Cerberus
Recent Hardware: Dell Laptop
Oldest Hardware: Commodore Amiga 1200 with 1084S Monitor & Blitz Basic 2.1

iWasAdam


Derron

BTW I could verify the mouse issue you had: If you by accident built a "console" version (not "gui") then it opens in a terminal and the event processing seems to be a bit borked. Will open up an issue for NG.

Uploading a new 1.0.1 later (VirtualBox update garbaged my Windows VM so the windows build takes a bit).

bye
Ron

Derron

#54
Uploaded v1.0.1 (Linux, Mac, Windows)
- fixed some colors leading to a titlescreen flicker (removed color alternate-trick on logo-text) - whopping 20 pixels
- fixed issue with "concurrent modification" of some TIntMaps leading to crashes
- (compared to the v1.0 it contains a sound-engine selector now - especially useful for Linuxers)

Download contains:
- legacy BlitzMax builds: Linux32, MacOS32, Windows32
- current BlitzMax NG builds: Linux64, MacOS64, Windows64

https://www.gamezworld.de/files/GenusPrime_v1.0.1_LinuxMacWindows.zip



I revived my "BlitzMax without additional modules"-ogg-streaming code, might test it later on with this project now as I know about some Mac users here ;-)
Works for vanilla now - NG segfaults and needs some love/adjustments.


bye
Ron

Derron

#55
Here is a build by IWasAdam based on the patch I posted this morning (so it still says v1.0 don't wonder). If my newest version crashes for you - let me know and until we get that fixed you can use IWasAdams build.

https://www.gamezworld.de/files/GenusPrime.mt.app.zip

Just extract and drop the GenusPrime.mt.app "file" (collection) into the GenusPrime directory.


bye
Ron

Xerra

I swapped out the source code with Rons revised source code and built the game. It worked ok - no more crashes but it doesn't end the first level when you win...
M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

Derron

#57
Will look into it this evening - when at home again. This happens because it also checks ship count to see if a player is dead (might have set all his last ships to flee to another planet). Somehow this count is now not updated properly for you (I use a cache...to count). It is decreased on a RemoveShip() call... Which now does not delete a ship immediately but in the following for loop of the update cycle. So I thought it is logically the same... Seems not.
As said I will have a look at it later.

Could you try my download ...does it crash as it does for IWasAdam?
If it crashes then one of you both will have to build a Mac version for me afterwards.

Bye
Ron

Xerra

Quote from: Derron on April 06, 2019, 15:35:40
Could you try my download ...does it crash as it does for IWasAdam?

Your version worked ok for me - apart from the bug where the level doesn't end. I just extracted the MacOS64 file and dropped it into my current folder - no crashes.
M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

Derron

Are you on macos 10.14 too?
Wonder why they both crash at Adams but not on yours. There's a difference between your systems.

Will fix the issue this evening.

Bye
Ron