ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Slow game?

This forum is the place to discuss the older ADRIFT versions 3.9 and 4.0.

Please refer to the ADRIFT 4 Manual for more information.

Slow game?

Postby Duncan_B » Thu Feb 16, 2012 8:12 pm

I just loaded up one of my old projects and noticed it runs more slowly than other adventures. My assumption is that it's because of the amount of events in the game being run immediately for one turn and repeating, of which there are safely more than 60. Is there a way to re-write these without getting rid of the effects they would create (triggered tasks) that might speed up the gameplay? I was thinking of maybe collapsing these events into a single "Run every turn" event which would be sectioned up into regions and execute the tasks, but I think that would be re-creating the same problem.

Suggestions?
User avatar
Duncan_B
 
Posts: 1204
Joined: Fri Apr 01, 2005 8:26 pm
Location: Chicago, Illinois

Re: Slow game?

Postby Campbell » Thu Feb 16, 2012 9:07 pm

I seem to recall the number of events can impact performance in v4.
ADRIFT Developer developer.
User avatar
Campbell
Site Admin
 
Posts: 4570
Joined: Sun Jun 23, 2002 11:05 am
Location: Edinburgh, Scotland

Re: Slow game?

Postby Duncan_B » Thu Feb 16, 2012 9:37 pm

I will try to collapse them then The ALR is also huge since it is in third person so maybe that could be another part of it
User avatar
Duncan_B
 
Posts: 1204
Joined: Fri Apr 01, 2005 8:26 pm
Location: Chicago, Illinois

Re: Slow game?

Postby DCBSupafly » Fri Feb 17, 2012 4:29 am

What's "huge"? My biggest ALR is probably under 50k.
User avatar
DCBSupafly
 
Posts: 290
Joined: Tue Jul 07, 2009 8:19 pm
Location: Indiana

Re: Slow game?

Postby ralphmerridew » Fri Feb 17, 2012 1:45 pm

The time it takes to process one round of the ALR is largely proportional to (the number of entries in the ALR) times (total length of text to be processed).

How does your game run compared to _The PK Girl_? Since that game ran acceptably 10 years ago, I doubt sheer scale is the problem.

Are there the same slowdowns when run under SCARE? (For example, IIRC, whenever the player completes a task, ADRIFT Runner loops over all events to see if they should start. SCARE will build up a table with that information when it loads the game.)
Bloodhounds can make you laugh and cuss in the same breath. They are endearing, faithful, and can sling drool ten feet in any direction. -- Virginia Lanier
User avatar
ralphmerridew
 
Posts: 2506
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri

Re: Slow game?

Postby Duncan_B » Sat Feb 18, 2012 11:09 pm

The ALR is only 36 kilobytes. It isn't slowed down at all in Gargoyle. So getting rid of events is the way to do it, 'ey?
User avatar
Duncan_B
 
Posts: 1204
Joined: Fri Apr 01, 2005 8:26 pm
Location: Chicago, Illinois

Re: Slow game?

Postby ralphmerridew » Sun Feb 19, 2012 3:03 am

Regarding the ALR, what matters is how many entries it has, not how big they are.
An ALR with 1000 10-byte entries will be slower than an ALR with one megabyte-long entry.
Bloodhounds can make you laugh and cuss in the same breath. They are endearing, faithful, and can sling drool ten feet in any direction. -- Virginia Lanier
User avatar
ralphmerridew
 
Posts: 2506
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri

Re: Slow game?

Postby DCBSupafly » Sun Feb 19, 2012 1:49 pm

ralphmerridew wrote:Regarding the ALR, what matters is how many entries it has, not how big they are.
An ALR with 1000 10-byte entries will be slower than an ALR with one megabyte-long entry.


Cool, makes sense.
User avatar
DCBSupafly
 
Posts: 290
Joined: Tue Jul 07, 2009 8:19 pm
Location: Indiana

Re: Slow game?

Postby DCBSupafly » Mon Feb 20, 2012 5:00 pm

My current project has 164 ALR lines and doesn't suffer at all for it. Safe to say ALR searching is not a significant factor?
User avatar
DCBSupafly
 
Posts: 290
Joined: Tue Jul 07, 2009 8:19 pm
Location: Indiana

Re: Slow game?

Postby ralphmerridew » Mon Feb 20, 2012 11:37 pm

I checked. PK Girl had 1700+ ALRs, and 300+ events, so I doubt that it's so solely the number of those that's causing trouble.

First, download PKG and see if it runs at a decent pace. If it doesn't, there's a problem with your computer.

What parts of your game are slowed down? I remember that ADRIFT would have very slow performance on tasks that heavily used Advanced Command Construction (braces / brackets / references), but I thought that was fixed.

Do some testing to see whether events actually are the cause of the slowdowns.

First thing, back up your game. Make multiple backups, if you can.

Next, open up one backup, and remove the ALR completely. See if that fixes the problems.

If it doesn't, try removing all the events completely and see if that does.
Bloodhounds can make you laugh and cuss in the same breath. They are endearing, faithful, and can sling drool ten feet in any direction. -- Virginia Lanier
User avatar
ralphmerridew
 
Posts: 2506
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri

Re: Slow game?

Postby phkb » Tue Feb 21, 2012 2:23 am

For comparison, the ALR in "Cursed" has 9861 lines, and is about 1mb in size. There are 156 events. The game itself is fine during play, although it takes a while to index the ALR at the start of play.
When I hit slowdown issues I found the issues were more about the following:
- wildcard commands (ie. using "*" in commands too often). Solution was to restructure the command to eliminate the need for the wildcard. Not always possible, obviously.
- having very complex commands (eg having commands like "[kill/hit/maim/destroy/murder/attack/fight] person {[with/using] [ax/axe/mattock/pick]}"). Solution was two-fold: restructuring the commands, and judicial usage of synonyms. Have to be careful, though. I shot myself in the foot a few times with adding synonyms.
My IF-related stuff can be found here
User avatar
phkb
 
Posts: 376
Joined: Thu Jan 06, 2005 3:27 am
Location: Sydney, Australia


Return to ADRIFT 3.9 and 4.0

Who is online

Users browsing this forum: No registered users and 10 guests