Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Vapourware Codexian Game Development Thread

Lance Treiber

Educated
Joined
Feb 23, 2019
Messages
65
Lance, you seem to know your programming, I have a simple but important question I'd like to ask you.

How did you generate all of these hexes (or square tiles) on the screen? I mean, what are they? Just some graphical overlay? Still impressive.

When I think of making an RPG with tiles, I think of having like 1000 game objects each representing individual tiles, and that seems bad. But you just have pathfinding, and the tiles on the ground and it seems great. What method is that? And how powerful are these tiles to contain game data?

Visually, the hexes are just one instanced static mesh placed any number of times. It's just one actor in the level.
Data-wise, they're structs in a container. As structs, they can hold additional runtime info, like who's standing in the hex. Or editor-time info, like the traverse cost: for example to dissuade NPCs from running over fire.
Generating them involves a lot of linetraces.
There's a class responsible for converting UE coordinates to Hex coordinates and back.
With that system in place, the cursor is hidden, but it gets the hex coordinates underneath it on Tick and moves a red hexagonal actor with a custom stencil depth. A post-processing material is used to ignore depth checks to draw the red hex on top of world geometry, but behind characters.

I'm planning to do more with hexes than Fallout originally did, taking inspirations from FOnline:
f28a21dde89d85d06b75946644df5541.gif


655ced95053004d4fe30ad075cc8fc5a.gif


e615c95da741ad15d55823f5cb7e274c.gif


If you ever work on Hexes, here's a must read article: https://www.redblobgames.com/grids/hexagons/
 
Last edited:

RobotSquirrel

Arcane
Developer
Joined
Aug 9, 2020
Messages
2,125
Location
Adelaide
then the only downside is file size and loading time
That's pretty much it. I try to keep loading time down as much as possible, I'm in the habit of just loading everything into a tilemap and we're good to go.
But its probably overkill for a Turnbased game with a static map.
 

Renegen

Arcane
Joined
Jun 5, 2011
Messages
4,064
When I think of making an RPG with tiles, I think of having like 1000 game objects each representing individual tiles, and that seems bad.
It is bad. Each of the "Tiles" are a uniform size meaning you can just use simple position values instead of individual objects. You'd only ever draw the objects for debug.
My suspicion on lance's implementation is he's using rays to find the height of each tile and to determine if the ray is inside a collider or not and if the tile is imperfect. Its pretty damn impressive though, I've not really seen a lot of people try to do that they usually stick to just using a tilemap for everything.
Thanks RobotSquirrel and Lance. I have very little experience with large containers of data, I tend to keep things separate.

Can you explain to me like I'm really dumb exactly how we know which of the tile data to update? I'm asking because they do not seem to have individual colliders.

How does an individual tile know that someone is standing on it? Maybe I'm missing something here. Can you generate 1000 raycasts that just stand up continuously and are able to intercept the player? I never heard of such a thing, I tend to use raycasts in a discrete manner. Having 1000 rays just standing there like hair on the level surface sounds clever, though I never saw anyone do that.
Or, maybe the player is continuously sending his position to the container, and the container is able to catalog that data into the right tile? It sounds bad to me because it requires the game objects to constantly send updates of their positions to some central tilemap.
 

RobotSquirrel

Arcane
Developer
Joined
Aug 9, 2020
Messages
2,125
Location
Adelaide
Or, maybe the player is continuously sending his position to the container, and the container is able to catalog that data into the right tile? It sounds bad to me because it requires the game objects to constantly send updates of their positions to some central tilemap.
The player wouldn't continuously send their position, you'd only check the position to when a player or character requested a move, then you would calculate A* because A* is computationally expensive as it predicts the moves the player will make step by step testing all adjacent tiles. Basically the data just sits there until its needed its not always running. Its important as good practice to only ever run bits of code when it is 100% crucial that the code runs, otherwise you're just wasting CPU this is why its considered generally bad practice to run a function on a frame update especially if you never turn it off you only do it if you really have to have that updating every frame, most of the time you won't need that a simple input trigger will be enough. When the player clicks then run the loop, it doesn't have to be run every frame.
Can you generate 1000 raycasts that just stand up continuously and are able to intercept the player?
Honestly sounds a bit overkill. You wouldn't have to use raycasts because the position of each tile aligns to the normal of each tile anyway there's no need to have a separate raycast - when I meantioned that I Was specifically referring to map generation not runtime. You would need raycasts to check if the tile is intersecting a mesh's collider that isn't aligned to the grid - then you'd turn the colliders off when you were done as they are no longer needed the grid automatically does collisions.
 

Renegen

Arcane
Joined
Jun 5, 2011
Messages
4,064
I should say that my tiles are a bit different. They have dynamic data. Like, the 'cost' of moving to a certain tile is not fixed in advance, it depends on what is currently placed on that tile, that's why we need a method of having the object on top of a tile (such as a door that's closed or open, or a wall, or a person) to somehow collide with the tile and give it data.

And a Fallout-like game needs it too. There are no static navmeshes or navigation tiles; since other characters, at minimum, can move on them, and the tiles need to then update their move costs reflecting that a character is standing on them. Any navigation system will require your tiles to have dynamic data, which tracks what is colliding with them in real time, or what is on top of them.

Some kind of collision detection is needed, and I just don't find any solutions outside of an update loop, which seems bad, or a individual collider box for every single tile.
 
Developer
Joined
Oct 26, 2016
Messages
2,288
Why would 1000 tiles be bad?
I have this problem with programing, I feel like if we have 1000 objects, it's already too much and things will take longer to run. I keep forgetting I'm not working on a MSX anymore.
Yeah of course it depends how it all ravels out but to be needlessly worried about "1000" loops is kinda silly. That was something I used to think about in 1996 but even then...

Consider you can setup a loop of a million object and give each one a simple instruction and measure the FPS and you might be surprised what you get.
 

Nathaniel3W

Rockwell Studios
Patron
Developer
Joined
Feb 5, 2015
Messages
1,305
Location
Washington, DC
Strap Yourselves In Codex Year of the Donut Codex+ Now Streaming!
I should say that my tiles are a bit different. They have dynamic data. Like, the 'cost' of moving to a certain tile is not fixed in advance, it depends on what is currently placed on that tile, that's why we need a method of having the object on top of a tile (such as a door that's closed or open, or a wall, or a person) to somehow collide with the tile and give it data.

And a Fallout-like game needs it too. There are no static navmeshes or navigation tiles; since other characters, at minimum, can move on them, and the tiles need to then update their move costs reflecting that a character is standing on them. Any navigation system will require your tiles to have dynamic data, which tracks what is colliding with them in real time, or what is on top of them.

Some kind of collision detection is needed, and I just don't find any solutions outside of an update loop, which seems bad, or a individual collider box for every single tile.
You just take a regular A* algorithm and tweak it as needed. Before deciding whether to explore a hex, you check to see whether it's passable. You just need to make the extra information available to the individual nodes. I used A* in Himeko Sutori and it worked great:



Himeko Sutori's pathfinding has movement cost (additional cost to climb up a wall in a castle assault), zone of control (no moving from one hex to another if both hexes are adjacent to an enemy), movement through ally-controlled hexes but not enemy-controlled hexes, destroyable obstacles, and flying units that can fly over walls and blocked hexes. All of the pathfinding is A* with extra logic thrown in.
 

Nathaniel3W

Rockwell Studios
Patron
Developer
Joined
Feb 5, 2015
Messages
1,305
Location
Washington, DC
Strap Yourselves In Codex Year of the Donut Codex+ Now Streaming!
Have a happy new year, game devs.

I just did a thing.



Posts like this take time and I don't know if they'll result in more customers seeing my game. It's kind of like how I mostly talk about my game in development forums (like this thread), and talking to other game developers doesn't really put me in front of my target audience. I guess we'll see if posts like this get any engagement, and maybe I'll do some more.
 

Lance Treiber

Educated
Joined
Feb 23, 2019
Messages
65
I should say that my tiles are a bit different. They have dynamic data. Like, the 'cost' of moving to a certain tile is not fixed in advance, it depends on what is currently placed on that tile, that's why we need a method of having the object on top of a tile (such as a door that's closed or open, or a wall, or a person) to somehow collide with the tile and give it data.

And a Fallout-like game needs it too. There are no static navmeshes or navigation tiles; since other characters, at minimum, can move on them, and the tiles need to then update their move costs reflecting that a character is standing on them. Any navigation system will require your tiles to have dynamic data, which tracks what is colliding with them in real time, or what is on top of them.

Some kind of collision detection is needed, and I just don't find any solutions outside of an update loop, which seems bad, or a individual collider box for every single tile.
No colliders necessary.
Any character or door can have a component that's responsible for occupying a hex. When the owner of the component moves, the component checks "am I still in the same hex as before?" If not, it's time to update some info.
A complicated object, like a barricade occupying multiple hexes, can have multiple components attached in different places. Hence, a barricade can occupy 3 hexes for example.
 
Vatnik
Joined
Sep 28, 2014
Messages
12,199
Location
USSR
Have a happy new year, game devs.

I just did a thing.



Posts like this take time and I don't know if they'll result in more customers seeing my game. It's kind of like how I mostly talk about my game in development forums (like this thread), and talking to other game developers doesn't really put me in front of my target audience. I guess we'll see if posts like this get any engagement, and maybe I'll do some more.

Hey, as I'm working on my own game and am really interested in ways of finding exposure, we could try something.
There's a large russian website for gamers where users can post articles, get upvotes, the article goes on the main page, gets free exposure. I've posted articles there before and gotten over 10k impressions and 500 comments sometimes.
If you write an article in English that would be about game-design/programming/art creation, talk about your sales numbers, provide a lot of screenshots and videos, and do a sort of post-mortem or the history of the game's development, I'd be willing to translate it and post it, just as an experiment, to see how much of a boost this gives to indie games. You could also submit it up on GamaSutra or some other journal for example.
To give you an idea of the format, here's an example of one of my articles about building a retro-gaming rig https://dtf.ru/hard/1475354-sborka-retro-riga-na-winxp-win98se (10k impressions, 473 comments) or my review of Pillars of Eternity https://dtf.ru/games/1961381-bumers...ternity-pochemu-igra-ne-dlya-staryh-vorchunov (26k impressions, 185 comments).
You can use Chrome's translate function if you want to read the content (select some text, right click, choose translate, then the browser will offer you to translate the entire page).
If you want to try, I'd have to post it in a less popular section for Indies, but I'm still interested in how much useful exposure it would give as an experiment.
 
Last edited:

beardalaxy

Educated
Joined
Jun 10, 2023
Messages
117
Happy New Year, everyone! I hope you can all make notable progress on your games this year. Take the reigns!

Here is my roadmap for 2024. It's a pretty good estimate of when things will be worked on as well as when they'll be done, I feel. I'm sure I'll be able to deliver on these, as I've gotten into a really good groove and my motivation to finish is at an all time high with how close the game is to completion. Look forward to it!

7bf803962b809d3e.png
 

beardalaxy

Educated
Joined
Jun 10, 2023
Messages
117
Just finished the chimneys/fireplaces. Basically, if someone is present and awake and the weather is cold, NPCs will have fires going in a building.
Locked doors will be worked on next. If there is an awake NPC inside of their home, the door will be unlocked. Otherwise, you'll need a specific party member to be able to lockpick. That will negatively affect your standing, however, which can stack up quickly. Places like castles, shops, churches, and taverns are open at all times.
 

beardalaxy

Educated
Joined
Jun 10, 2023
Messages
117
a specific party member to be able to lockpick. That will negatively affect your standing
Always found that annoying that doing something in secret inflicted reputational losses. If nobody sees you do it, how could it? I hope you make some checks for that.
The karma system is more for your character's actions and sort of how they carry themselves. I don't have anything like a reputation system or guards/fines or anything like that. It's more of the actions you take reflecting on your personality. If that makes sense. There are NPCs that might mention something about how you don't seem like a nice person, or something along those lines, but it's not like they know you've been breaking into people's houses.

It mainly affects dialogue changes and the ending. The actual choices themselves are usually more important than the positive or negative karma you get from them.
 

Twiglard

Poland Stronk
Patron
Staff Member
Joined
Aug 6, 2014
Messages
7,509
Location
Poland
Strap Yourselves In Codex Year of the Donut
FUCK NIGGERS. This took far longer than it should. I decided to have walls on the edge of the tile rather than walls and corners in the middle of the tile. This has benefits and drawbacks.

First it was like this (broken):
RXsLYXq.png


Now it's like this:

VchrG2E.png


It needs some polish and adjusting assets but basically does what it should do.

Edit: This is a better test rig:

3XTSuz0.png
 
Last edited:

RobotSquirrel

Arcane
Developer
Joined
Aug 9, 2020
Messages
2,125
Location
Adelaide
The channel has got some interesting videos. Mostly consisting of retro techniques for 2d.


Nebulus. I miss you little green space pig submarine alien. Its incredible how advanced that game was at the time, I remember it was the best game I had played on the Atari ST, it had amazing visuals and sound, ran smooth, most of the games on the ST tended to run poorly.
 

beardalaxy

Educated
Joined
Jun 10, 2023
Messages
117
The work I had planned for January is done! I have also already started work on February's tasks, and am almost done with cleaning up my to-do list. Of course, this list will only grow as I develop more, which is why there is a second entry for it later on as well. The last thing on my current to-do list is the credits for the game, which are pretty much set in stone at this point. I do have to make separate scenes for different endings, so it might take a bit, but certainly won't take a month and a half. I'm glad I'm getting things done faster than planned.
201884bd13afcba5.png
 
Developer
Joined
Mar 14, 2023
Messages
13
Why don't you use that title text from the game in the steam capsule?
I tried to do that but it's not that easy.
Basically, I would have to blow up the small title logo but I didn't like the results that came from it.
I can't just copy and paste it like you did because the pixel scale wouldn't match with the picture to the right.
I was struggling with that for a long time and probably was overthinking it way too much
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom