The Inventory

The Inventory

Postby Olla » Thu Aug 28, 2014 1:54 pm

I've leached this game for years so I decided id try and help the project a little, if no one minds that is :3

I'm not a writer so what I plan on doing is attempting to improve some of the game code if I'm able.

Firstly my eyes are set on the inventory, i cant be the only one who has noticed that the inventory becomes ass slow when there are more than 10 items in it,
For now ill start working on an extension and place my inventory code in there with out interfering with the original code base.

Now if this is ok with everyone feel free to tell me what I should or shouldn't do in here.
Olla
 
Posts: 3
Joined: Wed Aug 27, 2014 11:18 am

Re: The Inventory

Postby Wahn » Thu Aug 28, 2014 2:24 pm

Yay! Tech support :)

You're very welcome on the team.
User avatar
Wahn
 
Posts: 638
Joined: Mon Dec 09, 2013 2:57 pm

Re: The Inventory

Postby xinacs » Thu Feb 12, 2015 9:20 pm

Mh... I got the impression that Olla ran into problems (like the usual "no more time" effect ^^), so I wanted to have a look at this. Also: As a programmer I was curious about this Inform7 and have to say it is the weirdest "programming language" I came across in my history. Xd

To make a long story short:
I was able to speed up the inventory a little bit and changed some smaller things (e.g. the second column is no longer pushed to the right if the left entry has a (*) to show it is used).
If you're interested I would check it in (if I get the permission to push to this git hub from you first), so some experienced FS authors can have a look at it. :)
At the moment it is a separate file that can be included to use "scxinv" in the same way you would use "inv".
User avatar
xinacs
 
Posts: 26
Joined: Tue Feb 10, 2015 3:23 pm

Re: The Inventory

Postby nukuv » Fri Feb 13, 2015 7:05 am

If the code works without horrible bugs, do push it right along.
nukuv
Site Admin
 
Posts: 96
Joined: Mon Dec 09, 2013 10:38 am

Re: The Inventory

Postby xinacs » Fri Feb 13, 2015 7:59 am

the thing is: github tells me somthing like: "You are not authorized." Xd
Am I missing something here?
I have to say that - although I am working with git at work - I've never pushed something to github.

Edit:
I tried around some more, but it always ends like this:
Code: Select all
$ git push
ERROR: Permission to Nuku/Flexible-Survival.git denied to XinacS.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
User avatar
xinacs
 
Posts: 26
Joined: Tue Feb 10, 2015 3:23 pm

Re: The Inventory

Postby TigerStripes » Fri Feb 13, 2015 10:09 am

My guess is you're trying to upload directly to Nuku's folder. You need to make a fork of the directory and upload your change there. Once done, you then make a pull request.
User avatar
TigerStripes
 
Posts: 592
Joined: Mon Dec 09, 2013 4:39 pm

Re: The Inventory

Postby xinacs » Fri Feb 13, 2015 10:42 am

Yes, that was it. As I said: I am new to Github and didn't know of the necessity of forking. :)

Thanks a lot! My stuff is in there now. Somewhere... ^-^
User avatar
xinacs
 
Posts: 26
Joined: Tue Feb 10, 2015 3:23 pm

Re: The Inventory

Postby xinacs » Mon Feb 16, 2015 7:09 am

One of the slowdowns in the link managment is the search through existing links for the link command as this is slower than just adding the new links.
My first approach was to just clear the link list when the inventory was shown, but that affected the links before the inventory that are still on the screen (they would now to quite random things ^^).

Now I see those options to still be able to speed it up:

1) clear the screen when the inventory is shown, so the link list can be cleared as well.

2) only clear the list of links that has been created by the last call of "inventory". this will still enable the code to stop looking for existing links. the only possible negative effect is: a link from a former call to "inventory" is on the screen, which will not work as expected anymore.

3) keep the search for existing links in. this will lead to the "inventory" taking 3-4 times longer than without (in an example with win gargoyle and 34 items: 120ms vs. 440ms / in win glulxe: 4,500ms vs. 19,000ms).

At the moment I restored 3) to return to the expected behaviour. But I tend to think that number 1) would be nice...

Do you have any optionions about this? :)
User avatar
xinacs
 
Posts: 26
Joined: Tue Feb 10, 2015 3:23 pm

Re: The Inventory

Postby xinacs » Wed Feb 18, 2015 1:17 pm

resolved.

I added another flag so I know when there are no inv links in the hyperlink list and thus am able to skip the slow array search.
I think this is good enough for now.
User avatar
xinacs
 
Posts: 26
Joined: Tue Feb 10, 2015 3:23 pm

Re: The Inventory

Postby TigerStripes » Sat Feb 21, 2015 10:19 am

Thanks for the assistance with inventory stuff. I've not had the opportunity to full explore your updates, but I have come across at least one error while doing some unrelated beta-testing.

I started a fresh game, picked up the stuff in the bunker, started wielding the knife and then stepped into the library. I then decided I didn't want the knife and the following occurred:

>drop knife
You're wielding that, take it off first.

From this, it appears that the message for trying to drop an active weapon is giving the message for trying to drop worn equipment. Somewhere along the way, you may have lost that portion of the checks.

I don't know how much you've changed, but please check over the 'Inventory Management Enhancements' in mirumu's folder. I'd done some expansions and improvements to them in the past, but they may need revision depending on the changes you've made.
User avatar
TigerStripes
 
Posts: 592
Joined: Mon Dec 09, 2013 4:39 pm

Next

Return to Dev Chat

Who is online

Users browsing this forum: No registered users and 14 guests

cron