Last games I made were all top-down, this had quite some advantages, for one you only need one set of animations/graphics for all directions and with an  isometric view, sprites can overlap.

I solved this in my code to seperate the static content from the dynamtic content (static vegetation, vs moving units/agents).  In my case there are less agents than vegetation. So I loop through the static objects and see what it’s y positions is. This makes sure you only have to sort your static objects once on their y position, and you’ll only have to keep track of the y position of your moving agents. Besides sorting agents on the same level, I’ve also got different Z levels for rendering, this what keeps the tree canopy above the trunk of tree with a higher Y value.

public void draw(Graphics graphics) throws SlickException 
{
 
 Iterator iter = agentViews.values().iterator();
 float agentY = 0;
 AgentView agView = null;
  // Get the first agent
 if(iter.hasNext())
 {
   agView = (AgentView) iter.next();
   agentY = agView.getModel().getY();
 }
 // Loop through all the static objects on the same level
 boolean processingAgents;
 for(AgentView vegView : vegetiationViewsL0) 
 {
 
 float y = vegView.getModel().getY();
 
 if(agView != null)
 {
    // As long as the y  of the static object is higher (so lower on the screen) it will draw it first
 if(y >= agentY )
 {
   vegView.draw(graphics);
 }
 else
 {
    // Else draw the agent and check if there are other agents with a higher y than the current static object
   agView.draw(graphics);

 processingAgents = true;
 while(processingAgents)
 {
   if(iter.hasNext())
   {
     agView = (AgentView)iter.next();
     agentY = agView.getModel().getY();
     if(agentY > y)
     {
       agView.draw(graphics);
     }
     else
     {
        processingAgents = false;
     } 
   }
   else
   {
     agView= null;
     processingAgents = false;
   } 
 }
 vegView.draw(graphics);
 //System.out.println("Tree" + y); 
 }
 }
 else
 {
 vegView.draw(graphics);
 }
 
 }

fhZLR3P

And… It’s been a while. I’m still here, but there are so many side projects I’m working on I didn’t get to do much on Battlelance lately. I’ve been playing Dominions 4 a lot currently, while I’m not working at my day work. If you like turn based strategy games and can look past the old fashioned graphics, Dominions 4 is the game is for you. You create a pretender god, select a race (out of more than 75) based on our worlds mythologies and off you go! You fight to become the dominant religion in the world, after the previous god has left the world. In game the possibilities are almost endless. Do you want to turn a simple goat, who was donated to your temple by a poor farmer, into a death mage, riding the winds on his magical carpet all the while wielding a battleaxe with a copper arm you mounted on its body and commanding an army of frost-giants? Well, with this game you can! With more than 2000 different units and monsters, over 800 different spells and over 300 different kinds of items you can do about anything! Have a look here: http://www.illwinter.com/dom4/

We’re hosting our own private dedicated servers, so we created our own web interface to keep track of our turns, Dominions Orchestra. We’ll release it in due time 🙂

On a different note, I’ve been putting in some work in a procedural world generator, based on Perin Noise. I found this wonderful example on how to create your own height maps: http://www.float4x4.net/index.php/2010/06/generating-realistic-and-playable-terrain-height-maps/

This in combination with some nice colouring and fading results into the following landmasses:

Perin noise world

 

 

Character sheet

Posted: 2013/08/11 in Uncategorized

I have implemented experience points from kills, based on how many members are in your party/team, the average party level and the challenge rating of the enemy.

I’m building a new character sheet to display character information, including the experience points:

Beginnings of a character sheet

Beginnings of a character sheet

 

A few experience points from kills

A few experience points from kills

 

 

 

This went quicker then expected. I’ve uploaded a new version of Battlelance, now with the working inventory and loot drops from DM spawns. I’ve added a few new items that are in the dynamic loot spawn list. I might have broken a few things in PBEM with the addition of items, but I don’t have the time to test it for hours. So if you find any issues, please do report them. Hopefully it’ll improve the game 🙂

Next up is to revise the character menu, all those items clutter up the ability and spell lists, so it’s time to think about something more user friendly.

The changelog for version 0.04:

  • ADD: Inventory screen
  • ADD: Gave every character items
  • ADD: Equipment slots (more to come)
  • ADD: Item pickup/dropping
  • ADD: Loot drops (15% atm) from Dungeon master spawns
  • ADD: New items for spawns
  • ADD: 1 use items (healing potions, scrolls)
  • Fixed: DM screen issues in placement phase
  • Fixed: Attack bonus penalty becaus everybody had 0 strength

Here’s a small inventory test video. I’ve got the system so far that you can now equip, drop, pickup and unequip items. And multiplayer synchronization seems to work as well. So far the system works pretty good 🙂 Now I just different kinds of loot and perhaps a barter screen, where you can switch gear without having to drop it on the floor.

I’ve also noticed a bug in version 0.03, where your attack bonus was 5 points lower then normal (people won’t hit anything). I was a bit to enthusiastic with the RPG stats system and the chance of hitting something was also based on the strength of the character, but everybody has 0 strength atm…  I’ll try to get an updated version up as soon as possible, probably with the first version of the inventory so people can try it out.

Video  —  Posted: 2013/07/31 in Uncategorized
Tags: ,

As said in my last blog post, I’m working on an inventory system. Before all Battlelance characters where just a bunch of stats, from now on they’ll be stats and items! Ain’t that cool.

I’ve already got some work into a proof of concept of the inventory system I discussed earlier, and I have the basics working in game.

Each unit has a “Backpack” and a few equipment slots (to be determined). Some items have effects if they sit in your backpack, such as the health potion in the next example. Others give abilities and effects if they are equipped, such as the warhammer and full-plate armour in the said example.

Here are some screenshots on demonstrate my meaning:

Items in backpack

Items in backpack

Items equiped

Items equiped

This blog is mainly me thinking aloud on how items should work. Non of this is either set in stone, or the best way to go forwards. It’s just writing down some ideas on how to use ingame items in the context of Battlelance.

Items add a new layer to the game, they can be placed by a level designer at a critical point to just give you that health potion at just the right time. For Battlelance I hope to implement just that, but also more. The different characters already start with a certain equipment (atm just stats and abilities), some of those stats and abilities, like the possibility to strike with a sword or the armour rating of a fighter should be coming from the equipment he’s wearing. This means that items give these abilities and effects, but they can give them at certain times. A health potion can be drunk from the backpack, but a sword can only be used when equipped. This means an Item has a 4 lists:

  • Backpack effects
  • Backpack abilities
  • Equipped effects
  • Equipped abilities

Once a played picks up an item, the backpack effects will start to take effect, and the backpack abilities should be added to the list of player abilities. Once an item is equipped to the right slot (should be an property of the item), the equipped effects and abilities come into play. Equipping items should cost time, if it would cost an entire action point (you get one of them per turn). It means the player has to think very carefully about when switching weapons.

Chest with healing potion

Chest with healing potion