Serious Engine source released


I have done a PVRTrace capture, and it seems nothing is drawn.
I have some issue with the Makefile and the automaticaly generated code, so that maybe the cause. I have generated the file manually and compiling again, maybe that will help.
 
So,there was some issues with the "USE_PORTABLE_C" define, and some replacement function for their ASM counterpart where not working.
I used an x86 linux machine as a comparison and fixed some function, but the Sound is still badly broken.
serioussam8.png

Using Second Encounter data, I managed to have the demo running for a few seconds, before it freeze (another time I got a corruption error). Time to check with valgrind maybe (I think it's the sound routine that make the game unstable)...
The speed seems ok (not super fast, around 10~15 fps).
 

Attachments

  • serioussam9.png
    serioussam9.png
    341.6 KB · Views: 291
I'm holding my breath here... hope you can solve the sound quirks and get it running smoothly! serious sam would be so cool to have!
 
Fixed one more thing (but there are still many it seems).

This piece of code
Code:
static inline void BoxToGrid(
  const FLOATaabbox3D &boxEntity, INDEX &iMinX, INDEX &iMaxX, INDEX &iMinZ, INDEX &iMaxZ)
{
  FLOAT fMinX = boxEntity.Min()(1);
  FLOAT fMinZ = boxEntity.Min()(3);
  FLOAT fMaxX = boxEntity.Max()(1);
  FLOAT fMaxZ = boxEntity.Max()(3);
  iMinX = INDEX(floor(fMinX/GRID_CELLSIZE));
  iMinZ = INDEX(floor(fMinZ/GRID_CELLSIZE));
  iMaxX = INDEX(ceil(fMaxX/GRID_CELLSIZE));
  iMaxZ = INDEX(ceil(fMaxZ/GRID_CELLSIZE));

  iMinX = Clamp(iMinX, (INDEX)GRID_MIN, (INDEX)GRID_MAX);
  iMinZ = Clamp(iMinZ, (INDEX)GRID_MIN, (INDEX)GRID_MAX);
  iMaxX = Clamp(iMaxX, (INDEX)GRID_MIN, (INDEX)GRID_MAX);
  iMaxZ = Clamp(iMaxZ, (INDEX)GRID_MIN, (INDEX)GRID_MAX);
}
Had a different behavor on x86 and Arm.
I added, at the end of the function:
Code:
printf("MinXZ=%f/%f Max=%f/%f => %ld/%ld %ld/%ld\n", fMinX, fMinZ, fMaxX, fMaxZ, iMinX, iMinZ, iMaxX, iMaxZ);
To understand what's going on.
The difference of behavor is only when dealing with infinite (I tried with fast-math off of course, witht he same difference).

Here is the output on x86
Code:
MinXZ=-inf/-inf Max=inf/inf => -32000/-32000 -32000/-32000

and the case on arm
Code:
MinXZ=-inf/-inf Max=inf/inf => -32000/-32000 32000/32000

So yes, that's why I had sudenly some freeze. On x86, an infinite box mean, basicaly, no search, were on arm it meaned a huge search.
I changed the code to
Code:
static inline void BoxToGrid(
  const FLOATaabbox3D &boxEntity, INDEX &iMinX, INDEX &iMaxX, INDEX &iMinZ, INDEX &iMaxZ)
{
  FLOAT fMinX = boxEntity.Min()(1);
  FLOAT fMinZ = boxEntity.Min()(3);
  FLOAT fMaxX = boxEntity.Max()(1);
  FLOAT fMaxZ = boxEntity.Max()(3);
  iMinX = (isinf(fMinX))?INDEX(GRID_MIN):INDEX(floor(fMinX/GRID_CELLSIZE));
  iMinZ = (isinf(fMinZ))?INDEX(GRID_MIN):INDEX(floor(fMinZ/GRID_CELLSIZE));
  iMaxX = (isinf(fMaxX))?INDEX(GRID_MIN):INDEX(ceil(fMaxX/GRID_CELLSIZE));
  iMaxZ = (isinf(fMaxZ))?INDEX(GRID_MIN):INDEX(ceil(fMaxZ/GRID_CELLSIZE));

  iMinX = Clamp(iMinX, (INDEX)GRID_MIN, (INDEX)GRID_MAX);
  iMinZ = Clamp(iMinZ, (INDEX)GRID_MIN, (INDEX)GRID_MAX);
  iMaxX = Clamp(iMaxX, (INDEX)GRID_MIN, (INDEX)GRID_MAX);
  iMaxZ = Clamp(iMaxZ, (INDEX)GRID_MIN, (INDEX)GRID_MAX);
}
And now I don't freeze, but I crash with a memory corruption (and I have already disabled the sound procedures). Time to run valgrind!
 
Last edited:
Great, so casting +infinity to int gives you MININT on x86.
Dealing with floating point is always fun...
Yes, that's a strange behavor.
I guess casting any infinity to an int just gives 0xFFFFFFFF, regardless if it's signed or not.
[doublepost=1459849893,1459834736][/doublepost]Fixed another bug. I can now go ingame and start shooting things :D

Still no sound, and some C function of some ASM routine still need some work.

Right now, fps are between 9 and 13 fps most of the time, with defaut config and standard compile optimisation. I haven't started optimising yet (need a solid base first).
[doublepost=1459862952][/doublepost]Got the sound working.
I must say, dispite the relative slowniness of the game, it's quite impressive to see this game on the little Pandora :D Thoses outdoor environnement are large, with huge drawing distance, lots of (destructible) trees, and quite a lot of badies too.

Now, I have to start adapting the game to the Pandora, and start getting a few fps more if possible too.
 

Attachments

  • serioussam10.png
    serioussam10.png
    573.8 KB · Views: 303
  • serioussam11.png
    serioussam11.png
    340.7 KB · Views: 309
  • serioussam12.png
    serioussam12.png
    646.4 KB · Views: 310
  • serioussam13.png
    serioussam13.png
    619.8 KB · Views: 301
Hi all,

I just bought the first two games at GOG for ~$8, in anticipation :)

Cheers, Magic Sam
 
I loved these games but they do require very accurate controls because of the amount of enemies you encounter.
 
Just a small followup. Beta in ongoing. There are still issue, but its progressing...
serioussam15.png

Game is playable... Thats was before the filtering (mipmaping in fact) was fixed, but you can see the details textures are working nicely.

serioussam21.png

And I fixed the filtering that was wrong (for a long time, it was a libGL bug, thanks notaz for noticing it).
 
if you need beta testers, I'd love to give it a go! great progress, thanks a lot!
 
Just a small followup. Beta in ongoing. There are still issue, but its progressing...
Game is playable... Thats was before the filtering (mipmaping in fact) was fixed, but you can see the details textures are working nicely.

And I fixed the filtering that was wrong (for a long time, it was a libGL bug, thanks notaz for noticing it).

Nice, looks like I might have to dig out my wireless mouse.
 
Back
Top