worklog : 3d platform game (blitz3d)


👉 BlitzCoder will be building a new platform and other plans to preserve and continue the Blitz legacy.

To be able to achieve this goal, we need your support by becoming a Patreon Paid Member 👈

 

Tweet
RemiD

hi !

i don't why but i am in the mood to make a game, and after some thoughts, i have decided to create a 3d platform game, a gameplay like 'crash bandicoot' (on ps1), but with a level which is proceduraly generated.

let's see how far i can go this time...

first step : a test level and a character to test the movements and jumping / falling.
http://rd-stuff.fr/blitz3d/wip-bb-3d-platform-20230807-debugging-with-entitycolor-and-animframes-10fps.gif

i use linepick on near meshes to detect if there is a ground below player feet.

i use entitycolor to debug when the character is on air (in red) and when the character is on ground (in green).

i use 1 animation frame to debug each movement / action state (runing, jumping, falling).

it seems to work well !

RemiD commented:

http://rd-stuff.fr/blitz3d/wip-bb-3d-platform-20230807-detectgroundcollision-detectsidecollision-10fps.gif
i use only 1 linepick to detect the ground and 1 linepick to detect the obstacles on the sides, before translating player.

BlitzCoder commented:

Looking good so far 👍

..so only linepicks being used in collision or there's EntityPickMode or EntityPick?

RemiD commented:

entitypickmode() is necessary to set the near enough meshes as pickable (considered for the raypick).

tformvector() is used to define the vector corresponding to the direction / length of the movement (before moving / translating the character).

pickedEnt% = linepick() is used to throw the 3d ray and get the picked entity reference, if there is one. ( if it returns 0, no entity was picked, because not in range, or not in this direction).

i have already posted several code examples on how to detect collisions only using linepicks, but they may be a little too complicated.

i may post a more simple code example later.

RemiD commented:

2023.08.09 :
testing a 3d whirl effect using 2 textured cylinders (without top / bottom caps)
http://rd-stuff.fr/blitz3d/wip-bb-3d-platform-20230808-3d-whirl-destroy-boxes-10fps.gif

i may use a mesh like a rope in a spiral shape for this effect... maybe later

BlitzCoder commented:

nice

I may post a more simple code example later.

and it would be interesting to know how your 2 linepick collision works.

how about the jumping and landing, do you use gravity or something else?

RemiD commented:

how about the jumping and landing, do you use gravity or something else?

i separate the 2 raypicks / translations.

one raypick / translation on the y axis ( considering jump state / jump speed, and fall state / gravity speed ) ( y vector )

one raypick / translation on the x and z axises ( considering move keys pressed and move x, z, speed ) ( x, z, vector )

the player is translated on the y axis, only if nothing has been picked or the picked point is too far.

then the player is translated on the x, z axises, only if nothing has been picked or the picked point is too far.

RemiD commented:

2023.08.10 :
an attempt to generate nodes and paths to make a procedural map (corridors in the jungle, like in crash bandicoot 1)

http://rd-stuff.fr/blitz3d/wip-bb-3d-platform-20230811-paths-and-nodes-generator-for-map.png

;we create a new node
;the current node is the new node

;loop
;we start from the current node
;we try to create a temporary path, with a new orientation, and a new length, which does not go outside of the map (1000x1000z units), and which does not intersect with another existing path.
;if it is possible
;we create the new path
;we create a new node at the end of the path
;the current node is the new node

;until enough paths have been created or too many tries have been attempted to create a new path

RemiD commented:

2023.08.12 :
i have tried to use a terrain (ROAM) to make a path like in crash bandicoot, but it looked too 'stairy', so now i am trying to generate the path and borders and holes and obstacles and platforms, with premade parts (meshes).

http://rd-stuff.fr/blitz3d/wip-bb-3d-platform-20230812-paths-borders-junctions.png

the difficulty is to join 2 sections (when there are turns / bends ), i see 2 approaches for this :

  • connect the vertices from one section to the others ( the one before, the one next )
  • put another mesh on top of the empty seam so that it hides the emptyness
RemiD commented:

2023.08.13 :
i have modeled a premade terrain mesh of 5width * 10depth.
then copied this premade mesh for the different sections of the path, and then the challenge was to weld one section with the next section, because each section has a different yaw orientation (for turns), and each height varies randomly between +0 and +0.2 (to add some relief to the terrain).

so i had to code a procedure to determine which vertices on the seam of the 'from path' correspond to which vertices on the seam of the 'to path', and then get the global position of these vertices, and then calculate the vector, length, normal, between each 'from vertex' and each 'to vertex', and then calculate the middle position between each 2 vertices, where both vertices will be repositionned so that the terrains will be welded.

http://rd-stuff.fr/blitz3d/wip-bb-3d-platform-20230813-weld-vertices-of-different-sections.png
here you can see in blue the 'from vertex' (on the seam of the 'from path'), in cyan the 'to vertex' (on the seam of the 'to path'), in magenta the middle position where both vertices will be repositionned / welded.

of course all this will be done automatically by the procedure, this is only for debugging...

RemiD commented:

2023.08.14 : 
i have managed to weld the different sections (premade 5 x 10 terrains) (from side and to side)

http://rd-stuff.fr/blitz3d/wip-bb-3d-platform-20230814-weld-vertices-of-different-sections-success.png

some notes about repositioning vertices to assemble different premade meshes (premade surfaces) :

we must use rotatemesh(), then positionmesh() (and not the other way around), which changes the vertices positions, then tformpoint( vertx , verty, vertz, mesh, 0 ) can be used to find the global position of a vertex.

and not use rotateentity() / positionentity(), which changes the entity orientation / position.

RemiD commented:

i have no inspiration on how to make the environments / characters / gameplay for such a game, so i am currently watching the walktroughs of crash bandicoot 1, 2, 3, on the psone, to find some ideas.

i see that the environments are not necessarily a corridor / road... ok...

RemiD commented:

i have an idea for environments / things for maps, it would be like in the games 'cool spot', where the character is very small compared to our human size, which allow to make a simple map with comon environments / things, but with a tiny organism view. (like what an ant could see) 

2023.08.27 :
-each animation pose has now a specific face texture to express an emotion.
-testing a punch attack mechanic / animation.
http://rd-stuff.fr/blitz3d/wip-bb-3d-platform-20230827-attack-punch-10fps.gif

RemiD commented:

2023.08.28 :
-testing a shoot attack mechanic / animation
http://rd-stuff.fr/blitz3d/wip-bb-3d-platform-20230828-attack-shoot-15fps.gif

the projectile was sometimes created outside an obstacle / box (no problem in this case), but sometimes it was created inside an obstacle / box (and in this case the raypick for collision detection did not work because it was inside the mesh / surface, so i had to use an additional distance check to check if the projectile was inside a near obstacle / box).

edit : i have fixed the issue of a projectile sometimes created inside an obstacle / box (and therefore the raypick did not dectect any collision), by using :
tformpoint( 0, 0, -0.05-0.2, projectile, 0 )
sx# = tformedx() : sy# = tformedy() : sz# = tformedz()
tformvector( 0, 0, +0.05+0.2, projectile, 0 )
vx# = tformedx() :  vy# = tformedy() :  vz# = tformedz()
pickedent% = linepick( sx, sy, sz, vx, vy, vz, 0.05 )
which means that the start of the raypick is behind the projectile ( -radius-velocity ), and the vector of the raypick goes from behind the projectile to at the front of the projectile ( +radius+velocity ), and the radius of the pick is the radius of the projectile.

RemiD commented:

2023.08.30 :
-testing a walk / run animation (using only 4 poses... convincing enough for now...)
http://rd-stuff.fr/blitz3d/wip-bb-3d-platform-20230830-move-15fps.gif

RemiD commented:

2023.09.01 :
-testing a body slam mechanic / animation
http://rd-stuff.fr/blitz3d/wip-bb-3d-platform-20230901-attack-slam-15fps.gif

RemiD commented:

2023.09.04 :

RemiD commented:

2023.09.09 :

RemiD commented:

just to say that i don't work on this game anymore. maybe later...

Reply To Topic (minimum 10 characters)

Please log in to reply