Page 1 of 1

Development: Troubles with Mobs

Posted: Wed Jun 04, 2014 11:05 am
by Raner
Hi all -

I have managed to get the hang of this mostly - successfully added my real character's equipment to a test quest as rewards, threw together a few test enemies, and about 50% through my first map (I started big, oops).

I tripped over a few things along the way, but have found only one thing so far that is completely baffling me: Monster movement in combat. I lifted my formatting entirely from the Content Creator.

I have tried both protectSpawn and helpOthers for movementAggressionType, and neither worked. I have played around with max AP, move AP, attack AP - nothing seems to work.
With helpOthers: I get an error either when they attempt to move into my square, or if I end a turn with any alive and not adjacent to me (i.e., when they try to move to assist).
With protectSpawn: I get an error the moment I cross into their spawn range.
With wholeMap: Yep, insta-crash on map load, or within ~1 second of map load.

I have moved the spawn area around, ensured there is nothing in their way, and I consistently get an error similar to:

FATAL EXCEPTION: main
Process: com.gpl.rpg.AndorsTrail, PID: 1742
java.lang.ArrayIndexOutOfBoundsException: length:1089; index:2215
at com.gpl.rpg.AndorsTrail.controller.PathFinder.findPathBetween(PathFinder.java.37)

Errors come from MonsterMovementController.findPathFor / determineMonsterNextPosition / moveMonster / moveMonsters /onTick / onNewTick... etc, etc, etc.

I tried removing all monsters and spawns other than the affected monster - no joy.

Am I doing something obviously wrong, or is this something I simply should not be playing with at this time? Thanks for any suggestions or information. This is proving to be quite a bit of fun.

-Raner

Re: Development: Troubles with Mobs

Posted: Wed Jun 04, 2014 2:06 pm
by Zukero
The problem is that your map is too big.
There is a hard limit at 33x33, and anything beyond 30x30 is discouraged, to guarantee performance even on old, low-end devices.

If you just wanna have fun, you can try changing in src/com.gpl.rpg.AndorsTrail.controller.Constants.java the value of MAX_MAP_WIDTH and MAX_MAP_HEIGHT.

Re: Development: Troubles with Mobs

Posted: Wed Jun 04, 2014 3:08 pm
by Raner
Thanks. I should have gone back and tried the old pre-combination versions. I was not happy about some of the ways the maps came together when I tried 30x30. I guess I will have to get creative.

In ways it should be easy, as I work on it, parts of the joined map were becoming too fundamentally different in flavor and tone. I guess this means I have 3 maps at about 90 percent, and 3 more at maybe 40 percent. And maybe no more endless testing in emulator to see what I can see on the screen from one particular corner/square. *bangs head on desk*

Thanks for the quick reply. I will try to get something up in terms of screenshots and a basic 'story map' soon.

-Raner