12
Demolishun
214d

Been looking into 2D maps for a game. I am learning how to use tools that do autotiling. I want to have generated worlds for terrain. It is interesting how the scope of what you are learning starts expanding rapidly and can overwhelm you. I started wanting to learn autotiling. This went from that to autogen, to modifying terrain, to how to store generated terrain, to how to store difference between autogen and player modified, to how to separate things into chunks, to how to store a whole world worth of data! Like dude, chill. Just learn how to use autotiling first. Then learn how autogen, then learn how to efficiently chunk things,. Also the 2d data won't be big so just store the data you genned so if modified. The worlds don't have to be ultra huge. Really stop freaking out what it could be and see what it is. JUST FUCKING ITERATE!

It is wild to watch yourself get featuritus without learning how to crawl fist. Just divide and conquer.

Comments
  • 3
    Tbh, @chaosesqueteam2 project is maybe a great way to start. I compiled it and ran it. Worked directly out of the box. Uses SDL1.X not SDL2 (had to install those header rs).

    Edit: oh, 2d. Ignore what I said
  • 2
    idk half those things and I've autogenerated 2d worlds before a few times in my own codebases
  • 1
    @jestdotty doing it completely your own way must be amazing. Reminds me about my first interpreter before studying how to really do it. So much fun, the creativity. Kinda wish I didn't learn it from book later. It became boring now
  • 3
    @retoor I have built stuff by hand before game engines were really a thing in a meaningful way. I could not go back to that. I can create multiple times more content in a decent engine today. Combine that with generating some of the content and you can have huge scope worlds. One game I have been meaning to play is Daggerfall. From what I hear it had autogenerated content and had a huge scope to its world. Later games in the TES series didn't have that. So the scope was much lower.
  • 3
    The problem with "just fucking iterate" is that you want EVERYTHING and you want it RIGHT NOW.
  • 0
    @kamen I want it all and I want it NOW! ~ Queen, I think.

    https://youtube.com/watch/...
  • 1
    what i usually do, is start simple and expand. you don't need to have a perfect solution from the start.

    Nothing speaks against first just hardcoding some data, and figure out auto tiling in its simplest form.

    Next create an array and throw the data into there. Change stuff accordingly.

    Then split it up into chunks, or whatever structure makes sense. Implement serialization, synchronisation etc. Maybe a different method to address tiles, if needed.

    Build mapgen / editor and stuff like that. (or evolve it side by side)

    Optimize the solution at hand.

    Youll get to a satisfying result that way.

    No need to build the Spaceship with nothing but Sticks and Stones.
  • 0
    @jestdotty i did the same in Java and C++ aswell.
    Rust happens to be easier in that regard though, true.
  • 0
    now that i think of it, that's how i did it in Editors like Game Maker and Unity3D aswell. I remember using this same technique even with a few small C Projects, but i guess in C it's much harder to actually fix everything again, when you add stuff, hence why they only were small 😅
  • 3
    @Demolishun Arena has procedural generation too, but as I remember every location on the map is in it's own pocket dimension, so you can just keep exploring the wilderness forever and never reach another location.

    In Daggerfall the chunks are all connected instead, which is fucking awesome. There's not much in-between map markers, but you can still make the trip by foot ;>

    Also fucking shit, I want to get back to gamedev so bad. I'm tired of writing this fucking language. But I need it in order to make the game I want to make! ARGHHGHGHGHG
  • 0
    @Liebranca why don't you just choose the tools, after you draft your initial idea.

    Nobody's gonna give a shit (apart from a few devs maybe), if you built it in your own language, ASM or UE5, as long as it's fun and runs decent.
  • 1
    @thebiochemic Man, I could write a book about it. I exaggerate, but only slightly...

    The first problem is flat out no existing software can handle simulation on the scale that I want, and I'm not compromising on the design.

    Second problem is, while I could implement everything with an existing language, applying the kind of demented control freak optimizations I need is an uphill battle.

    This is not a "rewriting the hotspots" type scenario: I have to save absolutely every last cycle. And so the third problem: I'd have to write the entire thing in x86 assembler, and I could do that too, but it'd bring about other hellish problems of it's own.

    So: I wrote my *own* assembler to solve the problem and made it target a virtual machine that I can translate to physical architectures. With high level quality of life crap (classes, templates, inference, type-checking, etc ) at a low level, __maybe__ I have a shot at running the simulation at 60 fps. GOD WILLING.

    [INAUDIBLE PAIN]
  • 0
    @Liebranca i totally understand your point.
    But you will need to compromise sooner or later. There is simply no such thing as a "no compromises" video game.
  • 0
    i mean you set yourself up for compromises regardless, because you write your own stuff, that probably only runs on one OS on x86 arch. What about phones? PCs without GPUs or weaker CPUs? Older PCs? What about Consoles such as Playstation or XBox? What about 120Hz or 4k Monitors?
  • 1
    @Liebranca what are you simulating? What is the scale of this?
  • 2
    @Demolishun It's a dead simple, turn-based model. The world is broken down into areas, think of it like a hexgrid. Each area records "encounters" that happen within it -- these are, in short, random prompts where the player takes an action. Combat, choosing to travel, having a conversation, getting something to eat, going to sleep, whatever.

    After some number of encounters, the current state of the area is checked against the last few snapshots to detect changes. Depending on the type and magnitude of these, messages are sent to neighboring areas, which are affected.

    Those neighbors, after another number of encounters, do the same. This process keeps repeating indefinitely.

    So: you can bring change to the world during your turn, and if you do, then the world -- and the characters in it -- need to register it in order to make choices during *their* turn. That's it in a nutshell.

    Let's say I set a forest on fire. I want the... shit, I need another comment...
  • 1
    I want the druids or what have you to be upset that those entities died in a neighboring area, because their character sheets say they love trees, and the entities that died are tagged "tree" and "fucking dead", so they would spend their turns in response to what you did, in accordance to some plain like/dislike list they have.

    BUT: these type of reactions must happen dynamically. AND because these can also bring about changes to an area, they must also be recorded so that *other* NPCs can react!

    The mechanic is simple. But if you keep propagating like this, soon you have the entire world affected and a million fucking turns to simulate and record, it grows exponentially.

    We can limit the size of the world, the actor count, and giving areas that are farther away lesser priority so they're not simulated quite as often as areas near the player. But if you detonate a nuke, they must *eventually* hear about it!

    So it becomes a problem of fucking shit I'm sorry, another comment!
  • 1
    It becomes a problem of processing very large amounts of data, nothing too crazy in concept, and I'd be already cutting the workload a whole lot by making it turn-based.

    But it still needs to be heavily optimized because I want to at least *give* people the option to simulate a BIG map, with warring factions and all that shit.

    I can cut on other stuff like graphics or generating dialogue. Like, PS1 graphics and every idiot druid going like "O, [PLAYER], thou motherly fornicator! Thou hast burneth thy forest of [CELL-0AFB]! Prepare to die!" is fine by me.

    What I'm not willing to do is tone down the background simulation any more than absolutely necessary. As in, that simple mechanic that scales terribly IS the whole point of the game!

    Ugh, apologies that I took so long to write all of this. It's not so complicated but I struggle to find the right words.
  • 1
    @Liebranca I wonder if you can find real world data about populations and the propagation of interactions. Maybe there is a mathematical model that can be used to simulate this already. My first thought is that there would be delay in propagation and there would also be a ripple effect that causes incidents to lose energy. If there is a model that simulates this "energy" you might find in real life systems that energy dies out after a while. That might help scope the processing of events. But then you also have the it was so outrageous that an entire nation was wiped out scenario. Like what happened with the Benjamites.
  • 2
    @Demolishun @Liebranca i feel that it kinda sounds like a problem that Dwarf Fortress tried to solve aswell
  • 1
    @Demolishun Absolutely, there's bound to be some stuff to dig up. My working idea is storing the state of each slot in the grid as the relative balance between magical forces (fantasy shit like "war", "nature", "corruption" and such), and then weight everything else by how strongly this balance is disturbed: a funeral pyre goes largely unnoticed as everything is on fire.

    @thebiochemic I have never in my life played DF, so I don't know. I suppose the whole generating centuries worth of world history likely deals with this stuff, but AFAIK it's proprietary so I couldn't legally take any code from there, much less publish my derived work under GPL.
  • 2
    @thebiochemic in java I went architecture crazy

    in js you cannot do that because there is no compiler to tell you you're wrong, but writing anything in js is so quick and easy that I moved in

    also you can still monumentally fuck up java code. it's pretty easy to. lots of people do it. there's just tons of stuff they put in that has no business being put in, then someone else builds some awkward system on top of it and next thing you know you have a polymorphism chain where they aren't even using the original object's parameters anymore so why the hell are they extending it wtf

    I think it works with rust because of the awkward data and functions delineation. idk my brain is fucked but that's what my intuition is telling me for now
    but you basically can't do functions inheriting other functions, and super traits is probably fine

    also something else interesting I see is that writing out something seems to correlate to its... advanceness. so the more advanced an idea the more work
  • 2
    @Liebranca did you just literally go from "I wanna make a game" to "I'm making a game engine" to "I'm making a language so I can write my game engine"?

    I think it makes most sense to make basic bitch stuff with the existing tools then get angry at them _then_ build your own
  • 1
    @jestdotty the engine I am using (Godot) does everything through composition of scenes. Other than the Nodes themselves which are classes. So it is an interesting mix.
  • 3
    @jestdotty you make him sound like the Temple OS dude.
  • 2
    @Liebranca ok well

    it's called "travel time"

    have an output queue and propagate events only after X in-game time

    that way it's both realistic and shit don't explode

    also in real life there's some message dropping or telephone problems. been watching vikings and sometimes your whole family got murdered but you only find out a half a year later cuz that's how long it took them to find a dude willing to go on a boat to travel to your kingdom to tell you and then the king kills the messenger so nobody else gets to find out and distract his kingdom from his goals so technically there's no message received
  • 2
    @Liebranca yeah dwarf fortress simulates like thousands of years of drama for the full map before you play

    and also while you play

    I don't think you'll get sued by the dwarf fortress guy. loads of people have analyzed how he does things and copied it
    he isn't rich either he lives off ramen and keeps rejecting universities trying to bribe him to work for them so I don't think he would care
    also ideas can't be copyrighted, or something
    also it's confusing how copyrighting code even works to me
    also you aren't gonna just copy paste his stuff anyway?
    also it's pretty easy to see how someone else does something and take issue with little things about it and then just write your own thing that's better than theirs and that wouldn't belong to them by that point
  • 1
    @Liebranca please check out Dwarf fortress, it has some unique ideas, that you'll probably like.

    And the guy is pretty chill. He works on that game longer than minecraft exists, and released it just last year or so on steam. I'm pretty sure he would be happy for yet another inspiration thanks to his passion project.

    This game spawned a whole sub genre of strategy games if you will.
    Stuff like rimworld, Sons of syx, Odd realm, and many more.
  • 2
    @Demolishun No, she's right! I was BLESSED with DIVINE intellect to build His systems! BEHOLD THY HOLY PARSER! **STARTS CONVULSING**
Add Comment