2.90 star(s) 13 Votes

EverCursed

Newbie
May 2, 2019
32
24
Some fun coding stuff here:

I thought a little bit about how to implement a nice battle combat map system, and came up with a good solution. Should simplify pathfinding in battle terrain, at the expense of some cache locality.

When you allocate a buffer of cells, interleave each cell with an unreachable one like so:

Code:
[    ][cell][    ][cell][    ][cell][    ][from]
[cell][    ][cell][    ][cell][    ][cell][    ]
[    ][cell][    ][3, 2][    ][cell][    ][cell]
[cell][    ][cell][    ][cell][    ][cell][    ]
[    ][ to ][    ][cell][    ][cell][    ][to#2]

Then traversals become super simple. If our current position is {row = 3, column = 2},
  • move right -> {row, column + 2}
  • move left -> {row, column - 2}
  • move up and right -> {row - 1, column + 1}
  • move up and left -> {row - 1, column - 1}
  • move down and right -> {row + 1, column + 1}
  • move down and left -> {row + 1, column - 1}

Checking edges is also simple, just check for out of dimension bounds for the buffer. If a traversal is pushing us past the total internal column count or the total internal row count (or below zero for both), that move can't be made.

EDIT: The distance calculations below are wrong. I'll leave this in as an example of poor sample data picking.
EDIT: The issue is that stepping vertically, going down+left and down+right will take one step with this calculation.

To calculate the distance from a cell to another cell, you subtract the "coordinates" of those two cells, absolute value both components, sum them and divide by 2, will give the distance.

Code:
from = {0, 7}
to   = {4, 1}

sub  = {4 - 0, 1 - 7} = {4, -6}
abs  = |{4, -6}|  = {4, 6}
sum  = 4 + 6 = 10
div  = 10/2 = 5
EDIT: Here is the correct calculation. A little more complex than expected, but fine anyway.

We first count the number of rows we traveled, and if this number is smaller than the number of columns traveled, add half of the difference between column steps and row steps to our count.

Code:
from   = {0, 7}
to     = {4, 1}
count := 0

sub    = {4 - 0, 1 - 7} = {4, -6}
abs    = |{4, -6}|  = {4, 6}
count := 4
if  [4 < 6] -> true
    count += (6 - 4)/2 = 1
-------------------------
count : 5
Code:
from   = {0, 7}
to#2   = {4, 7}
count := 0

sub    = {4 - 0, 7 - 7} = {4, 0}
abs    = |{4, 0}|  = {4, 0}
count := 4
if  [4 < 0] -> false
    done
-------------------------
count : 4
 
Last edited:
  • Like
Reactions: docx

Ripe Banana Games

Member
Game Developer
May 11, 2018
138
420
and where is the campfire?
It's right next to where you start, like 2 steps away.

As for the bugs people are mentioning, I tried a couple more playthroughs and I'm not able to reproduce them, I'm even trying to click on shit like mad and stuff lol...

Send me the logs if you get a bug?
 

Mirajia

Newbie
Jul 22, 2017
36
18
Sorry dont waste your Time.
The Game has more Bugs as Game.
example:
When you Build the Orc Huntress House, you become new Orc Huntress. But when all Orc Huntress killed in Fight then you become never new Orc Huntress.
When you then Kill all Lizards , you become 20 new Orc Huntress from Boss, but from Orc Huntress House? never...
The Same was by the Orc Figther, all Fighter killed in Fight = never new Orc Fighter...
When you Killed all Spiders you come to a Female Human Huntress, you can Help her ore you can go. and Further... and Further... Yes you can Help Here all Time, and you can go. When you Help here many Times, and then you go, end the Loop.
 

Ripe Banana Games

Member
Game Developer
May 11, 2018
138
420
Sorry dont waste your Time.
The Game has more Bugs as Game.
example:
When you Build the Orc Huntress House, you become new Orc Huntress. But when all Orc Huntress killed in Fight then you become never new Orc Huntress.
When you then Kill all Lizards , you become 20 new Orc Huntress from Boss, but from Orc Huntress House? never...
The Same was by the Orc Figther, all Fighter killed in Fight = never new Orc Fighter...
When you Killed all Spiders you come to a Female Human Huntress, you can Help her ore you can go. and Further... and Further... Yes you can Help Here all Time, and you can go. When you Help here many Times, and then you go, end the Loop.
Troops from quest rewards show up in the garrison.

1602197678074.png
 

Mirajia

Newbie
Jul 22, 2017
36
18
Troops from quest rewards show up in the garrison.
Yes, but It doesn't matter if I get the Orc Huntress "from Boss" from the garrison or not, i never get new Orc Huntress from Orc Huntress House.
When all Orc Huntress or Orc Fighter frome your in Fight Killed, you can never new build in the Houses.
To possibly bypassing the bug, i had to beginn from Game to set 1 Person from all Fightergroups in the Garrision...
 

Ripe Banana Games

Member
Game Developer
May 11, 2018
138
420
Yes, but It doesn't matter if I get the Orc Huntress "from Boss" from the garrison or not, i never get new Orc Huntress from Orc Huntress House.
When all Orc Huntress or Orc Fighter frome your in Fight Killed, you can never new build in the Houses.
To possibly bypassing the bug, i had to beginn from Game to set 1 Person from all Fightergroups in the Garrision...
Troop growth refreshes every week, there will be more to hire at the beginning of the week.
 

Ripe Banana Games

Member
Game Developer
May 11, 2018
138
420
You dont understand the Problem.
When all Orc Huntress killed in Fight, in can never Hire new. The Number to Hire new Orc Huntress is 0 (Zero)
I tried this as well, let all creatures of a stack die, after waiting for new week or building the structure there were more to hire and they could be added to army just fine.

Are you waiting for population growth?
 

Mirajia

Newbie
Jul 22, 2017
36
18
Are you waiting for population growth?
Yes im waiting, i can Hire the other Groups (Headhunter "Available: 6" and Shaman "Available: 4"), but the Groups (Orc Huntress or Orc Fighter) have Available : 0
and yes i have Building the Structur (oc huntres house), i cant hire the Huntress or Fighter, not in the Stronghold, not in the own Group House (Huntress's League or Training Grounds)
001.PNG

002.PNG
 

Ripe Banana Games

Member
Game Developer
May 11, 2018
138
420
So I tested out the following chain of events:

Start the game, build the Training Grounds, Hire all the Orc Fighters, go get them all killed, wait for the week to end.

For me, they are showing up fine and can be hired and added to army no problem.

1602209697196.png

I keep trying, but so far I haven't been able to reproduce any of the bugs you guys have reported for 1.0.9.

Ultimately, I can't fix it if I can't find it, so I will really need logs at this point.
 
  • Like
Reactions: Retired123

billbaraka

Newbie
Dec 20, 2018
28
10
Sorry dont waste your Time.
The Game has more Bugs as Game.
example:
When you Build the Orc Huntress House, you become new Orc Huntress. But when all Orc Huntress killed in Fight then you become never new Orc Huntress.
When you then Kill all Lizards , you become 20 new Orc Huntress from Boss, but from Orc Huntress House? never...
The Same was by the Orc Figther, all Fighter killed in Fight = never new Orc Fighter...
When you Killed all Spiders you come to a Female Human Huntress, you can Help her ore you can go. and Further... and Further... Yes you can Help Here all Time, and you can go. When you Help here many Times, and then you go, end the Loop.
You *become* an orc huntress?? You turn into a female, wtf?
 

combige

Member
Jun 30, 2017
417
273
Even with such cg I don't think Heroes can be beaten. Will look into it to unprove myself some time tho.
 
2.90 star(s) 13 Votes