Rampartesque

Paul59

Active Member
Joined
Dec 13, 2018
Location
UK
I've made a few 2D landscape/terrain generators in the past mostly with the intention of making a roguelike game. I doubt now that I've got the enthusiasm (or stamina!) for such a project, so I thought I'd attempt a simple 'Rampart' like game but with simple randomly generated maps (no height or features such as rocks, rivers or trees). I've never played Rampart but I've watched a few videos and looked at some screenies. Here are the features I'm planning to steal and some of my own ideas...

  • Random (ok I'll get with it, 'procedurally generated') maps
  • Player castles that cost gold and stone to build (you have to pay the builders and have the resources after all). Build anytime, anywhere.
  • Probably a simple 'fog of war' view around castles
  • A finite number of enemy ships that sail around and attack player castles - destroying x percentage of ships ('domination') wins the game
  • Gold is obtained by destroying ships (handily, their treasure chests always wash up on shore!). They might also drop wood and iron, to be used to make cannon and mines.
  • Stone obtained by placing a stone mine within your walls - costs gold and maybe wood
  • Cannon can be placed in your castle's area of effect and cost gold
  • Stone, used to repair your walls comes in random 'Tetris' style shapes
  • Actually, I might add trees that you can 'harvest' with a cannon LOL
As a start, I've got a simple wrap-around map generator sorted. You can switch between moving the mouse over the world map (which updates the close up view) or activating the close up view but can't do anything there yet. Not bad for about 200 lines of code!

Here's a shaky GIF showing the current state of play...

sortof.gif
 

Paul59

Active Member
Joined
Dec 13, 2018
Location
UK
Dumped the mouse-click-to-switch-windows idea and implemented wrap-around keyboard scrolling of the close-up view with an indicator (just some white spots for now) on the world map. The mouse will only be used for placing or selecting items - added the ability to place (single) stone blocks just to check my indexing of the array is correct :D - will need to reflect those changes on the world map which is an image created when the world is generated.

Another jumpy GIF:

Peek 2019-03-28 20-57.gif
 

Paul59

Active Member
Joined
Dec 13, 2018
Location
UK
Change of game plan:
Cities need to be defended from enemy ships, castles/walls can be built nearby or at strategic points.
Probably won't implement the 'tetris' shaped stone blocks, seems pointless.

Added cities to the world
Added the ability to build and demolish walls and castles and uproot trees - all at a cost (or gain) of gold/stone/wood
Added a pick mode to select and get info on map cells

Next up, rework the main viewport to double the size of the tiny graphics Done :)
 
Last edited:

Paul59

Active Member
Joined
Dec 13, 2018
Location
UK
Changed world generation to create a single central continent (sometimes with islands) with cities near the coast and discarded the wraparound idea - it's easier to follow what's going on and means the upcoming code for enemies will be much simpler - hurrah!
Screenshot at 2019-04-03 14-47-18.png
 

Paul59

Active Member
Joined
Dec 13, 2018
Location
UK
Not much time at the minute but I've added in some basic routing information for enemy ships using potential fields/dykstra maps call them what you will. Now I just need to add the logic to follow the directions :D

This screenshot shows two cities(!) with debug routing info turned on:

541
 
Top Bottom