Reggie World ( Pandora , PC )

Previous topic - Next topic

nabz32

#195
It looks way better with point lights with attenuation,
but you have to place the lights strategically for this to look good

dreamerman

In all normal 3d games such light probes are placed specifically in some places so it would look good, only Raytracing is giving let's say better results if properly used.
Generally now it looks even better, but adding such lightning makes some mismatch between different elements, because there are no shadows that would darken some other elements, normally easier way to deal with such pre-backed light is to use ambient occlusion, but it's for more modern '3d engines', another way would be as already someone mentioned, to make graphic more cartoon-y with cel shading or brighter colors, it would change the art/graphic style of game but could be more appealing. Of course you may find some way to tune this even more, maybe lit up that grass that is closer to light source or something like this.
Good idea about leaves on trees :)
Check my source code editor for GLBasic - link Update: 20.04.2020

nabz32

Yes light is a problem in GLBasic, I also have the shadow routine working, but with a dynamic map model there is always the problem with shadows popping in suddenly, also the shadow effect from glbasic is still a bit buggy. I just wish we had proper ambient light in GLBasic, this would be a nice start to be able to set the color of the darkest parts of the models.

I finally added wind:

Also I fixed some bugs, added some more constants, encapsulated some repeating code in functions and the object hiding now takes two coordinates into account, before all objects where hidden, when they where behind x or z of player, now only the ones that really obscure the view of the player will be hidden

nabz32

Next step in development is dynamic houses.

I am in the process of creating a house editor, where you can lay down the foundation of the house which is stored in an array of 2D lines, the end point of the last line needs to connect to the start point of the first line, so the loop is closed. You can also add a negative foundation for creating houses with an inner yard.
The foundation of the house is grid based with the possibility of diagonal walls ( basically the editor just snaps to the grid for placing the points of the houses foundation )
Then I render walls from these 2 foundations for each story of the house there will be one generated wall ring.
A floor will be rendered for each floor ( flood filling the house foundation ), only interrupted by openings that can be placed on the floors.
I will actually build the wall rings 2 times, the second time the walls will be inverted ( also with different texture offsets to allow different inner wall textures ) those two walls will be rendered at the same time, because only front faces will be rendered they will not z-fight each other. When the player enters the house, the
outer wall ring is not displayed anymore, so you can only see the inner walls, also only the floor the player is on will be rendered, when the player enters the next floor, the floor will slowly blend in as the player transitions to the next floor.
Doors and windows can break the wall rings and will be left as openings when creating the models, meaning that you can only exit a house by doors and windows. Also you can see the inside of the houses through the window from outside and vice versa.
The only problem in this concept i am facing is finding a nice algorithm to automatically generate a roof for a build house. I have already created the outside line loop for the roof, so it will leap a bit over the walls by just translating the lines of the foundation outside and calculating the cut points to the translated, enlarged lines with their direct predecessors and ancestors.
Now I am thinking of doing the same, but translating the enlarged lines of the houses foundation to the inside of the house, also defining them finally by their cut points like the outer loop of the roof. This will be my first layer of roof, from this I can do the process again, till everything is filled with roofs. The only problem with this is, that some points can lay directly on other walls and have to be recalculated and also some points
will be removed ( duplicates that sit on top of each other ). With some points removed, the whole loop of points needs to be reordered correctly.
Also i need to keep track of the outer loop of roof to the inner loop, basically for creating the triangles correctly between the two loops. I hope to be able to resolve this, but it should be doable.
The final step will be to add inner walls to the house, so you can create rooms inside.

So basically a house consists of floors, outer walls ( one for each story ), inner walls ( specific to each story ) and the roof, which can easily be blended in and out.

This will have the great advantage of being able to seaminglesly enter houses on a map without loading times, the player could directly relate their position inside the house to the outside world.
 
Right now, the foundation editor is ready and outer wall rings can be rendered ( without the option to place doors and windows yet ), also the outer loop for the roof is created automatically.

I will keep you informed of the progress I make here and hope to be able to show something soon.


Kitty Hello

This is so awesome. When you want to "flood fill" a polygonal area, search the forum for "Delaunay". It's a triangulation method for polygons. Maybe that helps? For convex polygons, "ear clipping" is the algorithm you want. GPT is likely to provide code for you.

nabz32

Hi Gernot, the Problem is rather finding the polygons for the triangulation dynamically.
I have run into two problems while developing further:

I noticed that I can´t make faces transparent using alphamode when I colored them, I wanted to make different shades for the lawn tiles based on their angles, so I created 16 plains with vertex colors ranged from rgb(0,0,0) to rgb(255,255,255), it looks really nice, but the faces that have not rgb(255,255,255) won´t render transparency (ghosting) correctly, they just stay solid (transparent texture color is not displayed, as it should be).
Is this a known bug, is there a workaround for this?

Also I noticed some performance decrease where I just can´t find the reason, when the player is above a hole the performance drops for some reason, are there some performance analysis tools in the GLBasic IDE? Otherwise I need to log each function call and its duration manually to find the culpit.

I also made up my mind of the new direction of the actual game I want to build of this and made some gameplay drafts ( in Notepad++ ). Basically it will be focused on melee combat with enemies, the jump and run aspect will still be there but not as dominant like in the previous formula. And of course it will have a (hopefully ) nice story. Graphics wise I will polish it a bit, but I will still go for this N64 retro look.

dreamerman

In short for debbuging purpose, there are some general OpenGL debug/profiling tools (the older ones) that work with GLBasic and catch all called functions maybe even with some time statistic info, but I don't remember which ones at the moment. Narrowing issue with hand coded time checking functions in some crucial part can be usefull or disable some parts of rendering routine to check where can be the issue.
Check my source code editor for GLBasic - link Update: 20.04.2020

nabz32

Yes I will add a time log for the functions, I think I will make it only write if a certain key is held down, this way I won´t get gigantic logs. I think it will be nice to have in the future.

nabz32

I have added tree leafes reacting to player collision, I rotated them based on the proximity to the players / enemies, multiplied with the angle to the player, looks really nice.

I have completly rewritten the collision engine, now it is even smoother than before for diagonals, even with high frameskip values.

Now it is time to implement the player editor ( for assigning animation frames to different actions ) and a player action editor ( basically making combat moves editable ). Then I will add some fire calculations / effects, because I need burning lawn / trees for the story ). After this I can finally implement the new story / gameplay ( I made some maps for this allready ).


Kitty Hello

So cool to see, you're holding on to this. I really can learn a lot from you. I have a folder with lots of projects that I started but never finished. When the hard part is coded, I tend to lose interest. Keep it up!

nabz32

Thx for the kind words,

just some small updates done since my last post

* I added performance settings for the lawn effects ( view Distance of lawn can be set in percent ( it is allways related to draw size ) ).
* Lawn in close proximity to the player on another terrain level was also pushed down when the player was on ground, this has been fixed
* Fixed movement for the player when using a joystick
* Added bouncy wall detection also for enemies ( there is a wall type flag that will bounce the player off, like in a pinball machine, the texture of those walls can also change when it is bouncing something off, if it is properly defined in the TileShape Editor )
* Fixed a bug where height of static objects was reset to zero when an terrain update occured on a fixed area
* Created PlayerShape type and moved all hard coded animation frame references into it
* Created new maps
* Finished some animations of the new Player model in Blender, I will export it partially ( legs / arms / torso / head ) later this week, the reason why I export it partially is I want to change the model for the body parts on the fly ingame ( this is allready done like this for the old player model )





Kitty Hello

Can't you just change the texture instead of exporting the body parts separately? Or are there extras like super-muscles or Sonic/Hedgehog like legs?

nabz32

Yes I already have the texture changing in place, but I also want the arms legs etc. Have different models also. In addition I want to save some frames per model, for example I have the walking loop for the legs and be able to play different animations for the arms without having to do all the arm animations for all the leg animations. I want the model files to be small. I already started implementing this and the push / pop matrix commands are perfect for this.