worklog : 3d platform game (blitz3d)

Started by RemiD, August 07, 2023, 09:44:17

Previous topic - Next topic

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 !
8)

RemiD

#1
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.

col

This looks interesting and looks like it could turn into something really cool. It has the very early vibes of Crash Bandicoot style.

8)
https://github.com/davecamp

"When you observe the world through social media, you lose your faith in it."

markcwm

That's a good start Remi, the scene is reminding me of Aladdin or even Prince of Persia, something for the kids but not too hard.  Maybe if it was a city you could get away with a lot of straight lines and if there is plenty of scenery props. Then you could go anywhere, rather than CB's linear levels you could make it mission-based, get to the target and do something and finish that level, then you could reuse the same level but with different NPC positions. Sorry, just some ideas for you.

RemiD

#4
thanks for your comments / suggestions.

for now i focus on making a functional action / platform gameplay, and then i will decide what to do with this.

a gameplay similar to crash bandicoot (on ps1) with movement and jumping / falling, with holes and structures / obstacles and traps, and enemies, and boxes and items.
and additional abilities like to shoot projectiles (words), and to slash a sword (keyboard), and the famous whirl / tornado.

as you may have noticed the main character would be a blitz3d (bb) avatar.

and the bots would be others avatars (that we encounter on the interweb, like our avatars (images of profile) in this forum).

the environments will be proceduraly generated. easier for me...

MrmediamanX

#5
Looking solid, I've been messing around with a crash bandicoot like game myself.
https://pasteboard.co/aMLyRaMcQvik.png
Will give your game a go when it's done as 3d platformers are main genre.
It's a thing that doe's when it don't..

Baggey

Looking Good so far! Like the crash bandicot idea. I was also thinking it could be like walking down the death star alley where you shoot on coming badies behind crates and tie fighters coming at you. when you reach the end. Set the explosive to blow it all up!? :-X

Wish i could code Games like this. I have many ideas but just haven't worked out how to go about stuff like this yet. I learn everyday. Keep up the good work.

would like to see how far you go with this.

Kind Regards Baggey
Running a PC that just Aint fast enough!? i7 Quad core 24GB ram 1TB SSD and NVIDIA Quadro K620 . DID Technology stop! Or have we been assimulated!

ZX Spectrum 48k, C64, ORIC Atmos 48K, Enterprise 128K, The SID chip. Im Misunderstood!

RemiD

#7
@MrmediamanX>> nice ! crash bandicoot like indeed.

i am always impressed by your ability to make 3d environments by hand :)

on my side i have to rely on proceduraly generated environments (with premade parts), otherwise i get bored / fed up quite fast.


@Baggey>> i generaly post code examples of all the things that i use in my prototypes / games, so if you want, you can learn ;)

and there is also the old blitzbasic code archives : https://archive.blitzcoder.org/codearcs.html

also on this forum...

RemiD

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

RemiD

#9
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

#10
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

#11
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

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.

STEVIE G

A much simpler way to make the path would be to use a multi point bezier curve and build the mesh by extruding the perpendicular vector. Similar to building a procedural race track.

RemiD

QuoteA much simpler way to make the path would be to use a multi point bezier curve and build the mesh by extruding the perpendicular vector. Similar to building a procedural race track.
maybe, but i don't know how to do that. ???

and with my approach i start with nodes (points), having a position and an orientation, and then this will allow me to position the others components on each section, and then help me to do the occlusion culling (to determine which meshes / surfaces should be shown or hidden), and the pathfinding.

not sure if i could do that with 'bezier curve'.

also i think that i am doing to create a multi paths map, with door and keys instead of only one path.