Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3 4 ... 6

Author Topic: Mongrelmen - ascii RTS/town builder in development  (Read 19950 times)

pat

  • Bay Watcher
    • View Profile
Re: Mongrelmen - ascii RTS/town builder in development
« Reply #15 on: January 23, 2015, 08:00:03 pm »

This week I introduced gods and religion. There's 4 gods at the moment and the gameplay interaction is that you go about collecting lumber, build an altar and you are given a choice as to which religion it is dedicated. You can only pick one at this stage but I'm thinking of opening that up so you can dedicate different altars to different gods to create complicated interaction, but that's something for the future.

Currently we have:

Vecna - god of the undead, allies you with the undead faction and allows you to convert your entire stash of bones at once into skeleton allies.

Gruumsh - god of the orcs, allies you with the orcs (which is valuable because they are hugely destructive as a mob) and allows you to call for help where every nearby orc mob will swarm to the altar to help defend your base.

Trog - god of rage and fury, allows you to berserk a follower of your choosing to boost their attack but halve their defensive stats.

Meriadar - god of patience and mediation, I haven't decided on the mechanics yet but it's going to work subtly and much less obviously than the other gods.

I've also worked on putting in a few new monsters, most notably a unique in the form of Saint Othmar, a pacifist human wandering the world seeking out and destroying the undead.

Screenshot of Vecna at work with the mongrel workers collecting the lumber, building the altar and then being sacrificed to create a mongrel shaman with their corpses raised from the dead on the very altar they just finished building:

pat

  • Bay Watcher
    • View Profile
Re: Mongrelmen - ascii RTS/town builder in development
« Reply #16 on: January 26, 2015, 07:45:58 pm »

I worked on random map generation over the weekend. I originally had a simple terrain generator where I just randomly turned a number of squares impassable to create a few obstacles. There was no pattern or thinking behind this and the terrain rarely linked together and made much sense.

So I decided to revamp that. My algorithm now works roughly as follows:

1. Start with a blank map;
2. Pick a random starting point;
3. Draw a line of impassable tiles from that point to another nearby point;
4. Repeat 3 a number of times creating a kind of skeleton of a mountain range in different shapes;
5. Repeat from step 2 a number of times so that there is a few different "skeletons" spread throughout the map;
6. Loop through the map, removing unlinked squares and growing those "skeletons" by way of an algorithm based on cellular automata;
7. Finally, flood fill the map to see if there are any unreachable tiles, perhaps isolated inside a mountain, and if so, fill them.

I'm pretty happy with the results with the line drawing part of the algorithm in particular creating some interesting landscape formations. It seems to regularly produce long mountain ranges with nooks and crannies which effectively are caves. And along with the new terrain generator, I included the ability for the player to choose their initial starting position so you have the choice as to whether you want to take advantage of these caves and base yourself there or whether you'd prefer to build out in the open. One unintended side effect of this is that my pathfinding cost has risen quite a bit so that might need to be reconsidered if it proves to be a huge issue going forward.

Here's a picture of what it looks like:



Next up I think I want to work on rivers and ponds, perhaps even with a very similar algorithm but with longer lines involved so that there are a big stretches of straight water which periodically turn.

pat

  • Bay Watcher
    • View Profile
Re: Mongrelmen - ascii RTS/town builder in development
« Reply #17 on: January 30, 2015, 02:54:42 am »

More work done on terrain generation with bodies of water now in the game as well:



Something I did busted my pathfinding and AI routines though and it's slowed down a bunch for some reason. I'm going to have to dig through my changes and figure it out, which is very frustrating.

pat

  • Bay Watcher
    • View Profile
Re: Mongrelmen - ascii RTS/town builder in development
« Reply #18 on: January 30, 2015, 03:35:20 am »

Luckily that was a relatively easy bug to find and squash but it's opened the door to a whole number of other optimizations which I'm reluctant to get started on. Specifically in this case it was because everything on the map is stored in a list called objects. I was checking if squares were blocked by looping through that list everytime I needed to which is fairly intensive in python. I had actually already made a variable in the map tile to record whether there was a blocking object there which was updated each turn rather than for each AI which cared about whether it was blocked, and I just had to switch over to using that precalculated value. But the same logic should apply to other cases - I really should dig through and try and precalculate values needed by the AI's and probably separate objects into different lists, such as actors, items, jobs, etc.

I'm much keener to work on the fun stuff like making maps and things like that which is quick and easy in python but regrettably it's followed by the boring work of making things run efficiently when I inevitably do it badly.

Antsan

  • Bay Watcher
    • View Profile
Re: Mongrelmen - ascii RTS/town builder in development
« Reply #19 on: January 30, 2015, 05:34:37 am »

Maybe make a note that this is something you can optimize, go on doing other stuff, optimize when you come across something and sometimes later go over the code and check for left over parts which can still be optimized.
Not that I have any experience with that.
Logged
Taste my Paci-Fist

pat

  • Bay Watcher
    • View Profile
Re: Mongrelmen - ascii RTS/town builder in development
« Reply #20 on: January 30, 2015, 06:29:50 am »

yeah that's exactly it. They aren't even major changes, but the flow on effect of code breaking in all sorts of unexpected places is what worries me.

edit: ok, I just bit the bullet and had a crack at it, separating all objects into different lists of actors, items and jobs and it probably took me about ten minutes to do and only produced one bug so far which was easy to fix. Turns out I'm just lazy when I complained about that optimization!
« Last Edit: January 30, 2015, 06:49:16 am by pat »
Logged

Antsan

  • Bay Watcher
    • View Profile
Re: Mongrelmen - ascii RTS/town builder in development
« Reply #21 on: January 30, 2015, 07:11:59 am »

Well, that's good!

Is there a reason there is no public repository?
Logged
Taste my Paci-Fist

pat

  • Bay Watcher
    • View Profile
Re: Mongrelmen - ascii RTS/town builder in development
« Reply #22 on: January 30, 2015, 07:19:18 am »

Not really. The main reason is because it's a hobby project and I've never used a public repository before so I just haven't bothered to learn. I'd be happy to share the source code if anyone was interested but it's probably not much good for anyone else to learn from or contribute to because of my very poor coding practices.

What I will do right now though is put up a new dev build if anyone is interested and update the link in the original post.

Antsan

  • Bay Watcher
    • View Profile
Re: Mongrelmen - ascii RTS/town builder in development
« Reply #23 on: January 30, 2015, 07:30:38 am »

That would be cool.

Nice thing with repositories is that I always can just compile the latest version without waiting for someone else (in this case you) to do it. In other words: I'm just spoiled.
Logged
Taste my Paci-Fist

Antsan

  • Bay Watcher
    • View Profile
Re: Mongrelmen - ascii RTS/town builder in development
« Reply #24 on: January 31, 2015, 09:28:20 am »

Unfortunately this crashes when I wan to play it. That's probably because I am on Linux and tried to run it with wine.
Quote
Traceback (most recent call last):
  File "main.py", line 3421, in <module>
  File "main.py", line 3410, in main_menu
  File "main.py", line 3396, in play_game
  File "main.py", line 374, in process_ai
  File "main.py", line 1143, in take_turn
ValueError: list.remove(x): x not in list
I can play a bit before this happens. I have no idea what might be causing it.
Logged
Taste my Paci-Fist

pat

  • Bay Watcher
    • View Profile
Re: Mongrelmen - ascii RTS/town builder in development
« Reply #25 on: January 31, 2015, 04:03:32 pm »

That looks like a bug associated with those optimisations I was discussing before. Thanks for letting me know, I'll have a look at it.

pat

  • Bay Watcher
    • View Profile
Re: Mongrelmen - ascii RTS/town builder in development
« Reply #26 on: January 31, 2015, 05:01:29 pm »

yep, the bug was to do with necromancy and actors being killed, transferred onto the list of non-moving items and then raised from the dead which should mean they get switch back again. But I was checking the wrong list. I'll fix the dev build and the same link should work.

Pencil_Art

  • Bay Watcher
    • View Profile
Re: Mongrelmen - ascii RTS/town builder in development
« Reply #27 on: February 01, 2015, 12:40:17 am »

This looks really nice. Good job!
Logged

Arcvasti

  • Bay Watcher
  • [IS_ALREADY_HERE] [FRIENDSHIPPER:HIGH]
    • View Profile
Re: Mongrelmen - ascii RTS/town builder in development
« Reply #28 on: February 01, 2015, 01:00:49 am »

PTW
Logged
If you expect to live forever then you will never be disappointed.
Spooky Signature
To fix the horrid default colour scheme, follow the below steps:
Profile> Modify Profile> Look and Layout> Current Theme> (change)> Darkling

pat

  • Bay Watcher
    • View Profile
Re: Mongrelmen - ascii RTS/town builder in development
« Reply #29 on: February 01, 2015, 01:44:31 am »

This looks really nice. Good job!
thanks!

Today I worked on putting in workshops and the new unit of the mongrel soldier. Currently there's only a blacksmith and fletcher's workshop, which unlock unit progression to soldiers and sentries. I linked altar construction to upgrading to shamans. Next I'll need to expand the resource collection aspect of the game because currently the blacksmith makes swords out of bone and wood.

Here's an example fort with a few pits, walls and workshops nestled into a cave and river. The altar is dedicated to Gruumsh so those orcs are allied with me.

Pages: 1 [2] 3 4 ... 6