Improve performance?

(previously 'DEVELOPER') Private forum for registered community members. To register, please visit www.prison-architect.com/register.

Moderator: NBJeff

User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Re: Improve performance?

Postby xander » Tue Oct 01, 2013 4:02 pm

paktsardines wrote:
For instance, a quick Google of the algorithms involved in Starcraft 2 indicate groups of units traverse vastly simplified networks with some flocking and queuing algorithms thrown in to avoid collisions, speed things up a bit, and make things look pretty.


Exactly. Prison Architect is far more complex than Starcraft, so to compare it to starcraft is pointless. To clarify, starcraft units do not:

. Act under their own free will. That is, they do not have a hierarchy of needs to be constantly evaluated and acted upon.
. Need to constantly plan and evaluate escape options.
. Need to constantly evaluate contraband smuggling options.
. Have a mood than needs to be evaluated/adjusted every time events occur.
. Have to work out which direction to dig.
. Eat bacon

Every one of which adds a layer of complexity that Starcraft doesn't have.

To be fair, most of these items are linear in nature. That is, compared to the pathfinding, checking or incrementing needs and whatnot are likely trivial. Checking a need is a comparison (or perhaps a switch statement, which is a series of comparisons), and comparisons are very fast. Incrementing or decrementing a need is likewise quite fast, consisting of an addition. Working out which direction to dig is handled a priori using a flow map (watch the a13 video again).

As I am hesitant to say that Prison Architect is less complex than Starcraft 2, I am also hesitant to say that it is more complex. As I have said repeatedly, it is apples to oranges. Unless you really know what each game is doing, I don't know how you can possibly conclude that one is more complex than the other. For example, the units in SC give the appearance of behaving in a more complex manner than the units in PA, but the dynamic maps of PA seem more complicated than the static maps of SC. Without access to the source code, it is exceedingly difficult to comment.

xander
User avatar
sburymozza
level1
level1
Posts: 64
Joined: Tue Jun 25, 2013 7:52 am

Re: Improve performance?

Postby sburymozza » Tue Oct 01, 2013 11:44 pm

Has anybody played Towns? its a kind of same type of game you get immigrants on a island and build a Town and more immigrants arrive and you build food explore dungeons and so on, I have managed to get my Town up to 300 immigrants and not 1 bit of lag. 1 part is you have food prep so harvest wheat, turn to flour, make bread, store, eat, is one chain. You have weapon construction collecting the resources and then producing and storing the weapons for ppl to use. you can have a lot going on at any 1 time and across different floors, would the path finding be along the same lines i have played it from early stages and they never had issues with lag due to path finding?

http://www.townsgame.com/
dzlockhead
level1
level1
Posts: 15
Joined: Thu Oct 04, 2012 4:23 pm

Re: Improve performance?

Postby dzlockhead » Tue Oct 01, 2013 11:47 pm

sburymozza wrote:Has anybody played Towns? its a kind of same type of game you get immigrants on a island and build a Town and more immigrants arrive and you build food explore dungeons and so on, I have managed to get my Town up to 300 immigrants and not 1 bit of lag. 1 part is you have food prep so harvest wheat, turn to flour, make bread, store, eat, is one chain. You have weapon construction collecting the resources and then producing and storing the weapons for ppl to use. you can have a lot going on at any 1 time and across different floors, would the path finding be along the same lines i have played it from early stages and they never had issues with lag due to path finding?

http://www.townsgame.com/


I have towns too. Towns is coordinate based and the movement is a lot less natural, as towns moves diagonally or straight up and down. PA, I'm sure you have noticed sometimes the entities move in parabolic paths, this requires more mathematical computation and more processor time. PA is also much more intensive running a lot more background processes at the same time. ( I don't mean processes as in computer processes, but it's checking on a lot more conditions at the same time than in Towns). Towns is also more simple, also having two coders, while PA has one.
User avatar
sburymozza
level1
level1
Posts: 64
Joined: Tue Jun 25, 2013 7:52 am

Re: Improve performance?

Postby sburymozza » Wed Oct 02, 2013 12:23 am

dzlockhead wrote:
sburymozza wrote:Has anybody played Towns? its a kind of same type of game you get immigrants on a island and build a Town and more immigrants arrive and you build food explore dungeons and so on, I have managed to get my Town up to 300 immigrants and not 1 bit of lag. 1 part is you have food prep so harvest wheat, turn to flour, make bread, store, eat, is one chain. You have weapon construction collecting the resources and then producing and storing the weapons for ppl to use. you can have a lot going on at any 1 time and across different floors, would the path finding be along the same lines i have played it from early stages and they never had issues with lag due to path finding?

http://www.townsgame.com/


I have towns too. Towns is coordinate based and the movement is a lot less natural, as towns moves diagonally or straight up and down. PA, I'm sure you have noticed sometimes the entities move in parabolic paths, this requires more mathematical computation and more processor time. PA is also much more intensive running a lot more background processes at the same time. ( I don't mean processes as in computer processes, but it's checking on a lot more conditions at the same time than in Towns). Towns is also more simple, also having two coders, while PA has one.



Ok cheers for clearing that up not sure on how pathing is done really thought of Towns and there guys dont have issues, so will leave it to the experts, way to complex for me.
dzlockhead
level1
level1
Posts: 15
Joined: Thu Oct 04, 2012 4:23 pm

Re: Improve performance?

Postby dzlockhead » Wed Oct 02, 2013 12:30 am

sburymozza wrote:
dzlockhead wrote:
sburymozza wrote:Has anybody played Towns? its a kind of same type of game you get immigrants on a island and build a Town and more immigrants arrive and you build food explore dungeons and so on, I have managed to get my Town up to 300 immigrants and not 1 bit of lag. 1 part is you have food prep so harvest wheat, turn to flour, make bread, store, eat, is one chain. You have weapon construction collecting the resources and then producing and storing the weapons for ppl to use. you can have a lot going on at any 1 time and across different floors, would the path finding be along the same lines i have played it from early stages and they never had issues with lag due to path finding?

http://www.townsgame.com/


I have towns too. Towns is coordinate based and the movement is a lot less natural, as towns moves diagonally or straight up and down. PA, I'm sure you have noticed sometimes the entities move in parabolic paths, this requires more mathematical computation and more processor time. PA is also much more intensive running a lot more background processes at the same time. ( I don't mean processes as in computer processes, but it's checking on a lot more conditions at the same time than in Towns). Towns is also more simple, also having two coders, while PA has one.


Not 100% sure on it, I'm a computer engineering major but I still have a lot of programming courses, I'm only going off an educated guess, as I have no way of seeing PA or Towns' source code.

Ok cheers for clearing that up not sure on how pathing is done really thought of Towns and there guys dont have issues, so will leave it to the experts, way to complex for me.
yos233
level1
level1
Posts: 62
Joined: Thu Sep 05, 2013 8:27 pm

Re: Improve performance?

Postby yos233 » Wed Oct 02, 2013 3:27 am

The pathfinding in PA actually is tile-based. If you look closely at the current trailer or during the latest "live" development video, you can see the pathfinding algorithm operates on the same tiles that you build things on. What makes it different than Towns is that PA smoothes out movement, probably with a velocity vector. Actors (prisoners + staff) themselves are not actively locked to the tiles, however, their movement is.
JSwigart
level1
level1
Posts: 10
Joined: Fri Aug 30, 2013 11:30 pm

Re: Improve performance?

Postby JSwigart » Wed Oct 02, 2013 11:03 pm

I do A.I. for a living for 8 years now. There isn't any excuse for slow path finding in PA other than poor implementation. There is nothing complex about this game. It is the simplest game type available for pathfinding. Top down 2d, tile based, small maps, low unit count. Pathfinding should be a drop in the bucket, even without the usage of advanced techniques like flow fields(supreme commander 2), or influence maps. Some of the dev videos make it obvious they are pathfinding on the tile grid, but with the more velocity based path following, I wonder if it is repathing often when the velocity takes it out of the path tile corridor.

I wish the devs were willing to allow free outside code help, as it would be fun to contribute and help out.
Elandryl
level1
level1
Posts: 48
Joined: Sun Sep 29, 2013 12:43 pm

Re: Improve performance?

Postby Elandryl » Thu Oct 03, 2013 12:13 am

JSwigart wrote:I do A.I. for a living for 8 years now. There isn't any excuse for slow path finding in PA other than poor implementation. There is nothing complex about this game. It is the simplest game type available for pathfinding. Top down 2d, tile based, small maps, low unit count. Pathfinding should be a drop in the bucket, even without the usage of advanced techniques like flow fields(supreme commander 2), or influence maps. Some of the dev videos make it obvious they are pathfinding on the tile grid, but with the more velocity based path following, I wonder if it is repathing often when the velocity takes it out of the path tile corridor.


Thank you, I thought I was the only one to actually believe that Prison Architect wasn't using a state-of-the-art experimental IA, and that any modern computer should be able to make such a simple game run without any problem. That's not a judgement, it's just the way it is. A modern CPU is totally able to run game a hundred times more complex than PA run smoothly.
Sjiep
level0
Posts: 5
Joined: Sun Sep 01, 2013 6:09 pm

Re: Improve performance?

Postby Sjiep » Thu Oct 03, 2013 7:06 pm

Alpha 14 is great!

Having the pathfinding on a separate thread solved all my performance and sound issues.
I played the game for a few hours straight without having the need to restart. For me it is a lot more enjoyable to play now.

The Utilitly view still seems to have a few small issues in slight performance drop, but this goes away once you switch back. Since it is alpha and it doesn't really annoy when playing the game it shouldn't be of any concern.

Thumbs up! :D
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Re: Improve performance?

Postby xander » Thu Oct 03, 2013 7:53 pm

Elandryl wrote:Thank you, I thought I was the only one to actually believe that Prison Architect wasn't using a state-of-the-art experimental IA, and that any modern computer should be able to make such a simple game run without any problem.

I don't think that anyone ever contradicted that point.

xander

Return to “Community Members”

Who is online

Users browsing this forum: No registered users and 18 guests