Tuesday, March 17, 2009

Plague 3.19

  • added back end code to allow me to add arbitrary game objects easily. Will be useful in the future when players design bases. Use cursor keys to pick/place/remove. Only works in “test mode”. 
  • Removed some debug print code I shouldn't have left in (whoops!) 
  • added UI text so the player can see the formation (and placeable game object) 
  • sped up world partitioning algorithm, so it takes 2500ms instead of 5000 ms to partition an average level (speeds up map creation time by 33%). 
  • fixed the way sims pick up ammo and drop ammo – should get rid of weird ammo related bugs introduced in version 3.14.


Anonymous said...

no source version on download site yet, maybe I'm too fast, but win-exe version is already downloadable

Benedict Carter said...

Thanks for the notification. This isn't the first time a file hasn't finished uploading - I'm doing the Source319 again now.

Anonymous said...

thanks, I like the changes, however, I have to say the two most annoying bugs are still present:

- survivor stuck in ammo gathering mode - it appears to affect only better weapons - especially sniper gun and mini gun (I think laser too), it does not affect pistol, submachine gun, shotgun and assault rifle

- ammo gets removed at level start if I don't escape from starting point fast enough - I end up with 0 ammo then

the third problem is not so much a bug, but me wanting to keep the chosen weapon and not have to share it with survivors who tend to steal weapons on level start, before they can be aquired by player. that is even more problematic now, when there are 10 survivors by default, and they are spawned very near the player

Anonymous said...

I can confirm the ammo gathering bug for railgun

I also prefer small formations with clear forward and covered sides, like this:

if formation is 'diamond':
____separation = 1.5
____if position == 1:
________dir = self.object.direction+math.pi
____elif position == 2:
________dir = self.object.direction+math.pi*0.5
____elif position == 3:
________dir = self.object.direction+math.pi*1.5

____if position <= 3:
________offset = math.cos(dir), math.sin(dir)
________sim.command_destination = vect.add(1,self.object.destination,separation,offset)
________sim.command_destination = None

sean said...

Re: Survivors stealing your guns & ammo at the start of a level, you can change the relevent part of top_up_survivors() in main.py (around line 380) to this:

____stopcount = 0
____spacer = 2
____while count < max_count and stopcount < 1000:
________offset = (random.uniform(spacer, length) * choice((-1, 1))), (random.uniform(spacer, length) * choice((-1, 1)))
________new_location = location[0]+offset[0], location[1]+offset[1]

That should give you enough time to pick up all your guns and enough of your ammo to take care of business.

Benedict said...

Thanks for the bug reports Anon. I thought I had eliminated the ammo related bugs last night, but obviously not... I'll keep looking tonight. Thanks for the specificity, hopefully it'll help me track the problem(s) down. Those bugs also really annoy me.

I had something similar to your diamond (a ring that moved with you keeping forward clear) but I think it looked odd having everyone rotate about the player. I'll add it back in. I might go back tonight and add some more if I kill the ammo bugs (I want a side-by-side line, and a chevron). I'll also add your small diamond squad.

Thanks Sean, your changes added to working tree.

Anonymous said...

My biggest source of frustration right now is that AI survivors cluster so tightly that I can't maneuver/shoot around them. Changing formation so that I'm in front helps but it's still problematic.

My solution to this would be to have survivors stay 1.5 character widths away from each other. This would always leave room for the player to move through, and would give the survivors in the back better odds of getting a shot in.

SanityImpaired said...

From Plague 3.19,exe.log:
Traceback (most recent call last):
File "main.py", line 906, in [module]
File "main.py", line 895, in load_menu
File "main.py", line 876, in load_battle
File "engine.pyo", line 93, in start
File "engine.pyo", line 133, in __mainLoop
File "pygame\sprite.pyo", line 399, in update
File "simobject.pyo", line 1451, in update
File "simobject.pyo", line 367, in updateSim
File "physics.pyo", line 140, in update_kinematics
File "simobject.pyo", line 1431, in collision
File "simobject.pyo", line 1506, in check_pickup
File "inventory.pyo", line 34, in add
AttributeError: 'NoneType' object has no attribute 'stack_count'

Gotta love them bug reports. :)

Benedict Carter said...

Hi Anon,

changing the formation separation is a quick change, so I'll do that tonight.

Hi SanityImpaired,

I DO love those bug reports! :)

SanityImpaired said...

The last two were both me, the first time NoScript blocked it from accepting my name/site. :)

I tried upping the separation in formation_location(), but that only effects where they end up in formation. They still mash together into an unpassible clump while moving.

Ideally, there would be a minimum distance survivors are from one another at any given time, one wide enough for the player to fit through. Another solution would be to have the player push survivors out of the way rather than butting heads with them.

Benedict Carter said...

Yeah, the "smooshing" together of sims is annoying. However, to fix that without introducing more problems requires some pretty smart dynamic collision avoidance, and these guys dont have simple ca yet... hmmm it also bothers me that I have to fight my way through the crowd. Perhaps I'll put in a small kludge where they try to get away from you. Yes, that will probably work. Tomorrow night then! (along with the inevitable bug reports :) )

Benedict Carter said...

I've added some AI to other survivors avoid crowding you.Doesnt always work if they cant move (obviously I guess), but its much better than before.