Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411490 Posts in 69371 Topics- by 58428 Members - Latest Member: shelton786

April 24, 2024, 05:34:46 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsSTARMUSH - Warlocked-inspired RTS on otherworldly drugs
Pages: 1 2 [3]
Print
Author Topic: STARMUSH - Warlocked-inspired RTS on otherworldly drugs  (Read 8820 times)
GoatSkulls
Level 0
**



View Profile
« Reply #40 on: April 19, 2019, 04:35:56 PM »

Thanks for sharing the technical breakdown! I'm impressed you have the stamina to jump from full time dev into a jam and right back again. Keep at it!

Of course Kris with a K! I love nothing more than sharing technical details. There aren't any people in my life at present who enjoy talking about code problems and math love, so it is really fun to get to share it! I will definitely share more in the future. Feel free to ask whatever questions you like at any time.

Hah! I don't know if I do have the stamina, as it took me a couple days to recover, but it helps that development is practically my favorite thing to do, even if I cannot truly do it full time at the moment.


Project looks really cool. I like the unit special/magic stuff a lot and the rewind mechanic seems super unique. The idea of split screen in an RTS is very interesting to me - it is something that I have wanted to try before but it is hard to tell how well it will work. Will there be options for humans vs. cpu and interesting team compositions? You've inspired me to start thinking about RTS design again. How big is the unit tech tree going to be? It looks like quite a limited pool of units right now, is that by design or do you plan to expand it? Looking forward to being able to try your game!

Thanks jb! First, as a side note, I really dig what I've seen of Caesar's Revenge so far. Getting some nice warm and fuzzy Daggerfall vibes from it!

Splitscreen is definitely tricky, especially with so little pixels to work with. This being said, I think that a squished little multiplayer mode has its own sort of appeal, since all players are on a level playing field, constrained to the same viewing and controls-- see other games that are perhaps awkwardly tiny, like Starcraft 64 multiplayer. It is definitely not as user friendly as the core campaign, but it is a splitscreen RTS for couch co-op! Perhaps the rarity and novelty of it helps tip the balance in its favor.



In regards to Human/CPU options, I will unfortunately not be able to offer a CPU opponent in the 2-player maps when playing alone. The primary reason is that you can create your own 2-player maps in the map editor, and the VI I have made for the CPU is just not flexible enough for the spatial awareness required to make a consistently interesting and resilient opponent across any random combination of terrain. I started the project wanting to have more options in this regard, but at some point I realized the timeline was becoming unsustainable and I had to start cutting features. As a single person developing it in my sparse spare time, especially with it being an RTS, (practically the worst possible type of project to be doing alone if you are trying to compete in the genre in any capacity) I often have to take the lofi route, sadly. In the next strategy project I work on, I will definitely build on this foundation to add these options though (hopefully in the next couple years if all goes well).

This all being said, I plan on partially remedying the lack of 2-player CPU options with a SCENARIO mode that allows you to play against the CPU in interesting levels where you both have all structures/units/spells available. Sort of like a challenge / puzzle mode.



The tech tree is very small in comparison to those of modern RTSs, but it also has some weird unclassifiable elements that no other RTS does that I know of. I will first draw it, then explain what is going on. This will be the first post detailing how the dreamworld works!




The Starmush tech tree. It encompasses structures, units, upgrade research, dream research, and dream world inhabitants


BUILDINGS:
----------------------------------------
The NODE is the base structure, which allows the building of the DOME and ASSEMBLY structures.

Building the ASSEMBLY allows you to build a BATH, which in turn allows you to build WHIPS and DENS.



UNITS:
----------------------------------------
The NODE produces TECH units, and if you have a DEN, it can also produce DREAMERS, whose base spell can summon forth WORMS.

The ASSEMBLY produces PROTS and GUNNERS, and if you have a BATH, it can also produce FARCASTERS.



BASIC RESEARCH:
----------------------------------------
The BATH can research 4 different types of upgrades that boost the following unit stats in 3 levels: prot attack, prot armor, gunner attack, and farcaster attack.



ADVANCED RESEARCH:
----------------------------------------
The DEN can research 3 different spells: The Lanterns (painting with fire), The Eater (primordial infection), and the Sleeper (time travel). The Eater may be cast on either a NODE structure, or on a DREAMER who is part of the Sleeper ritual (i.e. when they are sleeping or casting it). When this is done, psychoactives infiltrate your biological components, and you transition to the dreamworld.



THE DREAM WORLD
----------------------------------------
When in the dream world, several things happen: The interface changes in color and movement, ancient carcasses come to life, ghosts appear across the map, and some units turn into ghosts. I will detail the new units/mechanics below.

Ancient Carcasses: Obeying whomever harvested remnants from them last, these titanic creatures each have their own spell / attack, and are extremely dangerous and difficult to destroy.

     SCRABBLER- a hulking aquatic insect that breathes forth acidic bubbles.

     DRAGON- a large amorphous wyrm that burns everything around it.

     BURROWER- a stationary shelled creature that can discharge immense electical arcs in defense.


Ghosts: whether crawling forth from the darkness, or emerging from your own units, these apparitions offer different abilities than normal units.

     FLITS- fast-moving gaseous eyes that explode on contact when directed to any unit or structure.

     SPARS- a bio-mechanical tangle of limbs that moves beneath the surface of the ground, and emerges in close combat with spinning implements that can strike more than one unit at a time. While underground they have a strong defense boost.

     WALKERS- crystalline capsules with modified appendages that can direct burning beams of energy outward as a ranged attack. If they are hit several times in a row by other ranged attacks, they compulsively deploy an energy shield that boosts the stats of surrounding friendly units.


All ghosts and carcasses can move freely over most terrain that is impassable to other units, like acid and mush. The alignment of ghosts, unlike carcasses, is determined somewhat randomly.





And that's it for now! It is certainly a limited pool to choose from, but it is, as you suggested, by design. I tried to pack in as much combat variety as I could in as little units as possible to prevent any watering down or redundancy. Combining this with the dream world mechanical shift, units can have fairly dynamic roles. I feel like many modern RTSs focus on unit quantity and combinations for combat variety-- unit numbers are often touted as a selling point. Especially as a solo developer, it just doesn't make sense to try to stretch myself in that way (though it would be super fun, given time/funding). Better to focus on things that bring multiple mechanical differences and different types of combat situations to the best of my abilities, even if it is on a smaller and perhaps more lofi scale than other RTSs.

I will make sure to keep you up to date!
« Last Edit: July 15, 2019, 06:20:03 AM by GoatSkulls » Logged
GoatSkulls
Level 0
**



View Profile
« Reply #41 on: June 19, 2019, 11:21:05 PM »

CATCHING UP
---------------------------------
Long time no see! Apologies for the absence. Got a much more stable/sustainable job, but the commute is long, so my evening time has been crunched in an interesting manner and I am still getting used to it. This being said, it is certainly fun figuring out how to work on games with such limitations! In a way, time constraints can help focus you-- especially when there are only a couple of precious hours to spare sometimes. Onward!


Most of the sporadic work for the past couple months has been devoted to menus and level navigation, most notably in multiplayer.


Previously, when you chose the Multiplayer game mode from the main menu, it simply took you to a random level, and when someone won, it took you to another random level, etc. Functional, but not very flexible.


I had to figure out a way of both listing the maps for play, and visualizing them so you could at least vaguely see their features. This is especially important, as map names are limited to 10 characters, and half of them are editor maps!


This really stumped me at first, because I had to find a commonality between in-engine maps and in-game-editor maps that could be used at a moments notice to display the map's content in a way that fits in a small menu at the resolution I have chosen. Not an easy task considering how little pixels I have to work with here.


Through a bit of experimentation though, I came to a solution (clunky and brutish though it may be) that benefits both the display of the map data and the editor save/load system in one fell swoop:



THE MAP DISPLAY & FILE READING

---------------------------------
Mush, acid, rocks, thorns, and even carcasses all exist at a tile/collision resolution of 14x14 px. A map may be made up of dirt tiles, units, buildings, and other things at varying resolutions, but the basic geography of the map is displayed well enough without them. If we just think of the 14x14 px tiles, and imagine having each one represented by a single pixel, it becomes a much more manageable size while still being descriptive enough visually.


Whether for readability or just a silly desire to see it work from an aesthetic perspective, I figured: why not just take the most direct route and make each pixel a letter, and store the strings in a text file to read back?



The multiplayer map 'PoisonWell' as it is written to a text file.

With some fiddling (i.e. figuring out how to loop through it efficiently while drawing pixels in the right spot), I got it reading back basic data in this form and making tiny pictures based upon the arrangements of the letters. After dressing it with a border, and getting the actual menu tossed together (and after much finangling of the data structures involved such that it reads the right file based upon the corresponding spot in the list it is reading from etc.), it began to function as intended.






The multiplayer map selection interface! Still lacking many maps, but its getting there. There may or may not be an obvious homage / adaption of a certain map from a certain game with a similar title in here...


I plan to add a couple of additional options beyond what is shown here (one-worker only or Node start, for instance), but what I have so far is a couple of map selection options apart from the basic choose-map-press-enter stuff:

-RANDOM MAP- 
selects a random map from the chosen pool

-MAP POOL-
selects the pool you want to randomize from, Local maps, Editor maps, or All maps

-AUTONEXT-
determines what happens upon victory/map change. Off returns to the map selection interface, Random chooses another map at random from the selected map pool, and Sequence plays the maps in order based upon the selected map pool.



This is all super standard stuff, and is not necessarily exciting or notable, but I think the Sequence AUTONEXT option has some potential: given that you will be able to edit the .INI files that store editor map level start dialogue, coupled with the fact that you can play editor maps in order from any given point you want to start at, you could make 2-player vs. campaigns! This will be a bit limited by how the maps are stored (i.e. 10 Smalls, 10 Mediums, 10 Larges in order), but I find it tantalizing nonetheless.






ONWARD
---------------------------------
I will go into greater detail soon about how this map display system has led to the creation of the editor save/load function, as well as other things I have been working on that are not multiplayer/editor related (dreamworld shenanigans and optimization of various things).


In other news, MOMOC won an award in the NES dev competition, which is super neat, but perhaps even cooler, back in April, Steve Clark, the legendary programmer of Warlocked himself, mentioned Starmush on Twitter:



!!!


High praise indeed, and surely one of the most amazing things I have experienced in the field of development since first picking up that marvelous game on the GBC and wondering at its technical workings.


He is an amazing fellow, and any goblins or hackers out there keen on the ZX should check out his stuff. Suffice to say, he is an actual wizard.





« Last Edit: June 23, 2019, 08:12:34 AM by GoatSkulls » Logged
Sustrato
Level 1
*


It's a good day to die.


View Profile
« Reply #42 on: July 14, 2019, 02:42:01 PM »

Congrats on the prize and mentions! Thanks for sharing the tech tree, it looks cool.

If one player enters the dreamworld, is the other pulled into it as well? Or do they continue fighting in the real world while the dream attacks are happening?

For Spars, seems redundant to have them move underground when ghosts bypass all terrain? Maybe they could have a twist on that convention somehow -- they bypass terrain by burrowing, but there is some terrain other ghosts can cross that they can't burrow through?
Logged

GoatSkulls
Level 0
**



View Profile
« Reply #43 on: July 15, 2019, 06:16:01 AM »

Congrats on the prize and mentions! Thanks for sharing the tech tree, it looks cool.

If one player enters the dreamworld, is the other pulled into it as well? Or do they continue fighting in the real world while the dream attacks are happening?

For Spars, seems redundant to have them move underground when ghosts bypass all terrain? Maybe they could have a twist on that convention somehow -- they bypass terrain by burrowing, but there is some terrain other ghosts can cross that they can't burrow through?


Thanks Kris with a K!

Yes, when one enters the dreamworld, both are pulled into it for a period of time.


In regards to Spars, I should have been a bit more clear: The underground movement of Spars is more of a hard combat counter to Farcasters / heavy ranged attacks, not a movement feature. When underground, they may be targeted and attacked like a normal unit, but like Worms in the non-dream world, they have a massive defense boost (and practically an immunity to electrical-based Whips / base defenses) until they emerge and are attacking.

I went back and edited in a snippet to the end of their description on the tech tree post.
« Last Edit: July 15, 2019, 06:22:24 AM by GoatSkulls » Logged
GoatSkulls
Level 0
**



View Profile
« Reply #44 on: August 13, 2022, 08:27:48 AM »

Back from the dead!

THE BAD NEWS:
I would like to state that the past several years have yielded leaps and bounds and I am close to full release. This is not the case-- hardly any meaningful work (with one exception detailed below) has taken place during the past 3 years due to the nature of the day job I had.


THE GOOD NEWS:
Jumped to yet another job recently with a much better balance that should allow me more time each week for Starmush, hopefully for real this time. Additionally, I have made some changes to Starmush with the goal of making it a more manageable and better-balanced project that can actually be completed in a reasonable amount of time. I will summarize my thoughts below:


CHANGES:
Change #1: The gameplay and overall balance has been turned on its head with a complete rewrite of the existing upgrade system. The basic Warcraft II / Starcraft inspired upgrade system that was in place was just not adding anything meaningful to the experience, and combined with the lackluster dreamworld mechanics (more on that below), it just wasn't focused enough on fun or on interesting strategic decisions. I opted to dive deep into laterally-oriented upgrade mechanics in RTSs and study as many as I could to sort out ways to improve the gameplay between the units / buildings I already have while minimizing changes needed to the codebase.

This yielded much more interesting results than before. It got even better when I changed them from static buy-em-once-and-you-have-them upgrades to OPTIONS you can swap between when you want to provided you have the energy / resources to do so. See an example below for the artillery unit in the game:

Before Rewrite-------------------------------------------------
Artillery Upgrade I   - Adds piercing damage to attack

Artillery Upgrade II  - Adds more piercing damage to attack

Artillery Upgrade III - Adds even more piercing damage to attack
---------------------------------------------------------------

After Rewrite--------------------------------------------------
Artillery Option I   - Shots now travel slowly in a line on the ground, dealing AOE damage along the given line before detonation at its target.

Artillery Option II  - Replaces explosive shells with a fan-shaped energy projector-- your artillery is now a directional AOE melee unit.

Artillery Option III - When below half health, the artillery becomes volatile, gains a bit of armor and speed, and can make a suicidal and explosive melee charge against targets you designate.
---------------------------------------------------------------


Now multiply these kinds of changes and upgrades by each unit in the game and now we are in a much larger and more intriguing possibility space than we were before. In creating these options I tried to focus on creating interesting choices, with none of them really being the 'best' option, and ensuring that the viability of the upgrades shift based on the options the other units are running, both yours and the enemy's. I don't want to give away all the options at present, but here are some more examples for illustration purposes:

-Upon death, Prots' bodies become a proximity-based landmine
-Techs can reboot after death once-- getting back up after a delay with 1/4 of their health intact
-Gunners can opt to maintain an AOE bubble shield instead of firing. The more gunners that work to maintain it, the larger the bubble becomes

There are 12 options in total (3 for each basic unit type). Not all are integrated yet, but I have a clear set of what abilities require what code laid out in an outline, and none of them seem to have any complications thus far. Playtesting will obviously help to refine these, but I think I am on the right path.



Change #2: The dreamworld no longer works like it used to, and is no longer really a part of the normal gameplay. The idea of it was cooler than the actual execution, and the units being added combined with the systems it took to integrate it within gameplay was just too much of a slog that wasn't yielding anything interesting. By comparison, the upgrade system changes detailed above are more fun to code, more fun to play, easier to integrate, and have their foundation already written due to the existing stuff in place from the old upgrades.



Change #3: Expectations. I took a hatchet to the list of things I have to do before hopping into full scale playtesting. Playtesting sooner rather than later will yield valuable insight into what works and what doesn't. Having it integrated into the normal development process is something I should've started at the get-go. It would likely have helped give me better direction at the very least, and probably prevented the wild goose chase on the dreamworld stuff. To the average developer this is definitely a 'No shit, dumdum' moment as you read this, but bear in mind I have only worked on tiny passion projects up to this point in my life, so I lacked perspective. Lesson learned: Get a minimum viable product as soon as possible and have testing be an integral part of the development cycle from the beginning to the end.




WHAT COMES NEXT:
The only thing I have left to do before getting playtesting started in earnest is the upgrade system modifications. I just want to get it working to the point that it functions without crashing, whether or not it is pretty. Only a couple of the upgrades even really require new sprite work (and the needed sprites are tiny), so I am hopeful that any aesthetic changes needed are minimal. I have axed everything else from the 'do this before getting it to people for testing' list as part of my journey towards repentance in fixing this dang project and getting it across the finish line.

This version will be pretty bare bones. Trying to focus on minimum viable product here. With this in mind:

August 2022 Build will NOT contain:
-sound / music
-keyboard rebinding
-hotkey-based camera position saving and loading
-map editor
-scenario mode
-majority of the campaign.

August 2022 Build WILL contain:
-some early campaign maps
-multiplayer mode with some maps (gamepad only at present in splitscreen for 2 players. Gamepad rebinding has been integrated, though, which is helpful).




MESSAGE ME IF YOU WANT TO PLAYTEST!
I have updated the title post to reflect this. Any degree of participation is appreciated, whether you want to go full volunteer QA on it in your feedback or you are just curious and want to try it out. No pressure one way or the other.

When the August 2022 build is ready, I will send keys out and the Itch.io page will go live for playtesters only. I am opting to keep it restricted to those with keys for the first round of testing. Once some more QOL additions are made (i.e. sound most importantly), I will start to open it up further on the road to the full release.

« Last Edit: August 13, 2022, 02:22:24 PM by GoatSkulls » Logged
beef
Level 0
*


View Profile
« Reply #45 on: August 23, 2022, 08:40:33 PM »

I know it's a typical thing to say here, but I created an account just to say that I'm excited to hear about you continuing this game! I frequently checked the post over the year(s) just in case you made an update. Glad to hear things are smoothing out for you. Smiley
Do you update anywhere else? I also enjoy your nesmakers posts!

Edit: I would love to playtest!
« Last Edit: August 31, 2022, 07:45:48 AM by beef » Logged
qMopey
Level 6
*


View Profile WWW
« Reply #46 on: August 30, 2022, 04:13:15 PM »

I'd definitely playtest Smiley
Logged
Ohmnivore
Level 0
***



View Profile WWW
« Reply #47 on: September 05, 2022, 09:44:26 AM »

Starmush has such a unique aesthetic and vision, glad you're back! I was still checking this page once in a while.

The new upgrades sound great. Agreed, it's a richer possibility space slash interaction matrix and they sound fun to develop.

I volunteer to playtest of course.
Logged

GoatSkulls
Level 0
**



View Profile
« Reply #48 on: October 27, 2022, 05:41:02 AM »

Graphical issues delayed the August itch build I am sorry to say. Once I get it ironed out in the coming weeks I will be sure to send out keys to those who have asked previously and recently, so no worries-- Haven't forgotten, I am just a pro at underestimating issues I have to tackle, but tackle them I shall.

@Ohmnivore -- Thanks! It means a lot. So glad to hear from you again.

@qMopey -- lol no worries, you never left the playtesting list! You were officially the first person to get on it several years ago.

@beef -- It is because of comments like yours that I continue to develop and power through doubts and issues to overcome challenges; Despite any cost in time / money, even if just one person gets some fun out of this project in its lifetime, I will have succeeded.

I have gotten you on the list as well. Glad to hear you like my amateurish ASM ramblings lol. Maybe when I am done with Starmush a century from now I can make another NES game. It is a cozy platform to explore to be sure, and one I would love to revisit in earnest someday.

I do not post anywhere else at present apart from TigSource and random thoughts sometimes on that NM forum. This being stated, whether in the near future for promotional purposes, or at the end of Starmush development when I try to return to sane-person project scopes, I think I need to overcome my social media aversion and make something to catalogue projects / WIP / thoughts / etc., whether in the form of a centralized blog, Pinterest, Instagram, channel on Discord, all of the above etc.
Logged
beef
Level 0
*


View Profile
« Reply #49 on: October 27, 2022, 04:23:00 PM »

Take all the time you need on developing a game. Live your life, do the things you do and enjoy! I don't think you should ever feel any sort of "pressure" to develop the thing you love, because you should love it first, and release it second. Smiley

We all underestimate how much work something will take, but for passion projects, tomorrow is another day. Success should be measured in what fun you had, haha.

Hell, my passion project is ongoing and has taken too many years: https://gameseed-gx.github.io/ Smiley
But yeah -- looking forward to anything you work on, it's been fun to watch progress!
Logged
GoatSkulls
Level 0
**



View Profile
« Reply #50 on: December 31, 2023, 04:45:31 PM »

Take all the time you need on developing a game. Live your life, do the things you do and enjoy! I don't think you should ever feel any sort of "pressure" to develop the thing you love, because you should love it first, and release it second. Smiley

We all underestimate how much work something will take, but for passion projects, tomorrow is another day. Success should be measured in what fun you had, haha.

Wonderful words of wisdom to live by for sure! Digging the hardware project-- I love mini consoles in all their myriad forms. Yours looks amazing and I will be following it with great interest. Maybe when it comes out I will make a tiny project for it!

---------------------------------------------------

As is tradition at this point, here is my long overdue annual 'I'm not dead yet post' since I struggle with regular updates.

Many life / job changes going on since last time, and a LOT of Starmush changes. Previously I discussed unexpected graphical issues I was encountering (tiles and some other components were not reliably drawing out of the blue despite no changes to those systems). This ended up pointing to a larger issue with incompatibility in the version of the engine I am working in, and led to me having to port the whole thing forward, bug hunt a bunch of odd things, and rewrite chunks of my systems that relied on some now deprecated functions.

One of these losses was unfortunately an undocumented behavior I was relying on for the time travel mechanic (because I am smart and that is definitely a good stable foundation to build a mechanic around lol. Lesson learned-- while things can just 'work' and that's good, at least release the dang project before the cumulative effects of software updates change the functions you work in jeez). This led to time travel being replaced with another mechanic that I found to be just as cool in execution but more useful, though it took a lot of brainstorming and testing. Details on this are forthcoming, but it is super exciting to me.

In the realm of lateral unit research / unit type swapping, things were progressing smoothly in a manner that I thought would be sustainable to get playtesting going within (albeit very late) until I found that some of the abilities were being held back by my primitive collision avoidance script. Like, REALLY being held back. Using some abilities while trying to get dwellers where they need to go was proving way too micro intensive because of their lack of pathfinding. I decided it was finally time to just buckle down and make a full grid-based navigational system for unit movement and interaction instead of relying on my simple steering script. Thankfully some assets exist for purchase in all engines for grid-related stuff, and I used one as a basis to start on, though I have had to radically customize it for all of my odd choices and mechanics, and add a lot of functionality it did not have to suit my needs. After much fiddling I have beautiful pathing and local collision avoidance working in tandem at last:



And lo! In the year of 2023 it came to pass that units don't get stuck around the simplest of corners anymore, and intelligently find their way as you direct them!

Yea so it doesn't look that impressive but this radically changes the way a lot of stuff works on the back end, and makes it WAY more user friendly, both with basic orders and unit abilities. It does however make the resource-related systems a nightmare to troubleshoot, but that is a post for another time.

As a technical highlight, I want to go over something that seems simple in pathfinding systems, but is actually a bit of a hurdle. I think I found a novel solution to it and I want to share it in case it proves useful to folks.

THE PROBLEM:
A* pathfinding systems are fantastic for finding paths around obstacles. This being stated, in its most basic form it does not do a good job getting you to where the next best guess is if there is no viable path. With multiple groups of units moving about simultaneously, other dynamic stuff like buildings being placed, spells and abilities flying around that mess with this etc., it becomes very difficult to figure out where you went wrong in your pathing, and therefore what on earth the 'next best thing' even can be defined as in your planning.

Instead of figuring out exactly where a path goes wrong, I figured that there must be a cost effective way of finding a guess that was 'good enough' for the purpose of trying to send a unit across a ton of terrain to a spot that might not be navigable, or for them trying to make a best guess when their original options are all exhausted in such a manner that they don't just stop what they are doing and give up completely.

THE SOLUTION:
There are multiple ways of approaching this issue that far more competent developers have devised, but I didn't really find anything that I understood fully enough to devote time to. This being stated, while trawling through the Warcraft 2 source code for potential ideas (Patrick Wyatt's bytemask and length-based pathing is amazing and efficient but not something I am up for trying to replicate), I noticed the recurring use of Bresenham's Line Algorithm. After a bit of a Wikipedia dive on the subject, I found that this indirectly inspired an answer.

Bresenham's Line Algorithm is awesome. It is one of the very first computer graphic algorithms, developed in 1962 by Jack Elton Bresenham at IBM. In very simple terms, it can efficiently find a line between two points in the form of connected grid squares using very simple midpoint maths. This is obviously useful for drawing lines, but it is also useful for doing a bunch of other things if you have something that relies on grid-based calculations (like paths!).

My rough idea was as follows: It is inefficient to try to iterate backwards through the terrain from your goal with A* to try to find the nearest spot that is navigable. It is much more efficient if you could instead only check navigability when you know that you have crossed impassable sections of terrain, so instead of having a check per grid space you instead have a check per potential obstacle, which should be (in most cases) a small fraction of the CPU cost of checking the entire line. Illustration time:



This shows step by step what happens when I run my best guess script. Green is starting position, red is the end goal the player clicked on. Orange represents the different test points we are checking as they advance from both the start side and the end side. Blue filled in tiles are impassable. Further explanation below.

I have a couple of iterations of Bresenham's running at the resolution of the navgrid (7x7px). It only checks the contents of each cell on the navgrid once. When it reaches a new cell, it simply looks up the data on the navgrid (i.e. 1=impassable, 0=clear). I have one script for each type of check I want for simplicity:

Bresenham_To (advances until it hits an impassable obstacle, and stores the position right before it)
Bresenham_Thru (advances through an impassable obstacle until it finds a free spot, then stores that position)

With these building blocks in place, let's find the best guess in the above image. Steps below correspond with the number on the given frame for reference. These steps are done in a while() loop where it simply alternates between which side it is checking from. The overall number of times it runs is limited by an arbitrary number of cycles (I use 10 at present) to make sure it doesn't go forever and it doesn't take up too much CPU agonizing over finding the bestest guess of them all.


FIND YOUR BEST GUESS:
--------------------------------------
1) Randomly choose if you want to begin checking from the start point or the end point. This one is beginning from the start point, shown as a green square. Move to the nearest obstacle, through it, and then until you hit the next one. Check if this test point is contiguous*** with your start point. If it is, check if its contiguous with your goal test point. If it is , your goal test point is your final position. As it most certainly is not in this case, move to step 2  (if it isn't contiguous with our start point, the last free spot before the obstacle was our best guess). (***I am using the word contiguous in these cases to mean that it is connected with the other spot by a path calculated with A*).

2) Check from the opposite side (in this case now the end point). Move to the nearest obstacle and through it. Check if this test point is contiguous with your starting point. It isn't in this case, so move to step 3.

3) Do the same process as 1 for the start side (minus the random choosing and the first move to the obstacle obviously).

4) Do the same process as 2 for the end side.

5) Do the same process as 1 for the start side-- AHHH. While we are now contiguous with our end test point (both test points are shown in red here), we are no longer contiguous with our start! This means the last point we found on our side is the best one!

6) Store the last known test point before the obstacle that was contiguous with the start.

7) Make a path to it, and that is probably as good a guess as my poor inadequately-coded unit can make.
--------------------------------------

There is a little bit more to it behind the scenes, like checking for edge cases where there may be a simple solution-- if there is only a single impassable obstacle between you and the goal, you don't have to run this whole process. This can be done by simply crossing the first obstacle from the start or end and using A* to check for a valid path. If you have one, then you know that your best guess is the last point in a line from the start direction before the given impassable obstacle. If this doesn't work, there is more complicated terrain in play.

Additionally, I had to write in some edge case checks to ensure that the scripts don't assume that diagonals are passable because it passes through them while completing its simplified checks.

I tested this in a lot of different configurations on paper and in-game and it seems to give damn good guesses even in bonkers terrain configurations (good in the sense that they look vaguely intelligent). That is a success in my book, especially given that we are using A* a number of times we can count on our fingers rather than a large iterative brute force nightmare.


NEXT STEPS:
I have a bunch of bugs to squash and systems to finish filling out with the new grid stuff before it'll be in the realm of possibility to playtest sadly, so it will be another long while. I will make no promises and just see how I do in the coming year so as to not let anyone including myself down in my assumptions.

Now that things are coming together a little more smoothly, I have dedicated a little bit of time to sorting out a more fitting direction for promo art and theming that matches the new focus on abilities / spells. New promo art stuff is amorphous and not high priority at present, but something of interest is that I think the project now no longer fits its original title of STARMUSH. I did a lot of thinking on this based on recent changes to the game, and I have come to something much closer to the vibe I am shooting for that should play into the new art stuff:

MUTEMUS

Pronounced Mew-teh-miss, (or moo-teh-moos for those who like its non-butchered Latin pronunciation).

More details and changes in this regard are coming. I am keeping the scope small and trying to just focus on the essentials for the game at present, so I will probably leave the title of this devlog as Starmush in the meantime until I get some new promo art going and have time to pretty the main post page up.
« Last Edit: December 31, 2023, 05:04:08 PM by GoatSkulls » Logged
joe_eyemobi
Level 3
***


Fledgling Indie Developer


View Profile WWW
« Reply #51 on: January 01, 2024, 12:05:23 AM »

This looks amazing!  Definitely gives me a nostalgia trip with the old-school DOS RTS vibes from Warcraft/C&C.  Will be keeping an eye on this.  Blink
Logged

mecholdem
Level 0
**


View Profile
« Reply #52 on: January 01, 2024, 03:16:43 AM »

Yes the images are very cool. You seem a little crazy with some 320x200. Maybe you could try a normal (big) resolution with these big pixeled sprites. The moves would be smoother. + ability to make a nicer writings
Logged
Ohmnivore
Level 0
***



View Profile WWW
« Reply #53 on: January 11, 2024, 07:18:23 PM »

Looks awesome! Exciting update Beer!
Logged

nathy after dark
Level 8
***


Open Sourceress


View Profile WWW
« Reply #54 on: January 21, 2024, 08:08:27 AM »

Awesome visuals, love the mushroom forest. Gonna have to read through for the technical stuff later.
Logged

Pages: 1 2 [3]
Print
Jump to:  

Theme orange-lt created by panic