June 19, 2019, 03:07:52 AM

Author Topic: Genus Prime - 8-BIT WARS competition entry  (Read 1557 times)

Offline Xerra

  • Hero Member
  • *****
  • Posts: 602
    • Retro Evolved
Re: Genus Prime - 8-BIT WARS competition entry
« Reply #45 on: April 05, 2019, 05:48:30 PM »
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.

Offline Xerra

  • Hero Member
  • *****
  • Posts: 602
    • Retro Evolved
Re: Genus Prime - 8-BIT WARS competition entry
« Reply #46 on: April 05, 2019, 05:49:54 PM »
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.

Offline Derron

  • Hero Member
  • *****
  • Posts: 2154
Re: Genus Prime - 8-BIT WARS competition entry
« Reply #47 on: April 05, 2019, 05:55:26 PM »
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

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1110
Re: Genus Prime - 8-BIT WARS competition entry
« Reply #48 on: April 06, 2019, 06:53:57 AM »
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?

Offline Derron

  • Hero Member
  • *****
  • Posts: 2154
Re: Genus Prime - 8-BIT WARS competition entry
« Reply #49 on: April 06, 2019, 07:02:05 AM »
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:
Code: [Select]
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

Offline Derron

  • Hero Member
  • *****
  • Posts: 2154
Re: Genus Prime - 8-BIT WARS competition entry
« Reply #50 on: April 06, 2019, 07:35:34 AM »
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

Offline 3DzForMe

  • Hero Member
  • *****
  • Posts: 583
Re: Genus Prime - 8-BIT WARS competition entry
« Reply #51 on: April 06, 2019, 07:41:49 AM »
Awesome gameplay Derron, love the associated sound as well.


Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1110
Re: Genus Prime - 8-BIT WARS competition entry
« Reply #52 on: April 06, 2019, 08:01:19 AM »
yep, the new code worked :)

Offline Derron

  • Hero Member
  • *****
  • Posts: 2154
Re: Genus Prime - 8-BIT WARS competition entry
« Reply #53 on: April 06, 2019, 08:03:19 AM »
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

Offline Derron

  • Hero Member
  • *****
  • Posts: 2154
Re: Genus Prime - 8-BIT WARS competition entry
« Reply #54 on: April 06, 2019, 08:32:14 AM »
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

Offline Derron

  • Hero Member
  • *****
  • Posts: 2154
Re: Genus Prime - 8-BIT WARS competition entry
« Reply #55 on: April 06, 2019, 12:26:53 PM »
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

Offline Xerra

  • Hero Member
  • *****
  • Posts: 602
    • Retro Evolved
Re: Genus Prime - 8-BIT WARS competition entry
« Reply #56 on: April 06, 2019, 01:50:23 PM »
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...

Offline Derron

  • Hero Member
  • *****
  • Posts: 2154
Re: Genus Prime - 8-BIT WARS competition entry
« Reply #57 on: April 06, 2019, 03:35:40 PM »
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

Offline Xerra

  • Hero Member
  • *****
  • Posts: 602
    • Retro Evolved
Re: Genus Prime - 8-BIT WARS competition entry
« Reply #58 on: April 06, 2019, 03:57:48 PM »
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.

Offline Derron

  • Hero Member
  • *****
  • Posts: 2154
Re: Genus Prime - 8-BIT WARS competition entry
« Reply #59 on: April 06, 2019, 04:15:35 PM »
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