Author Topic: Inventory problem  (Read 16381 times)

0 Members and 1 Guest are viewing this topic.

Offline lskovlun

Re: Inventory problem
« Reply #15 on: December 11, 2018, 05:12:15 PM »
Find the root cause before concluding that the problem is your memory usage (speaking of... what IS your memory usage?). It actually seems really weird that you would run out of memory right at the game start if you add that one extra inventory item, but not if you play the game for a while with one less inventory item. Right?
Come to think of it, Kawa had symptoms of the same sort when trying to make a new template game. On the other hand, that task is fraught. But you never know.

Offline Kawa

Re: Inventory problem
« Reply #16 on: December 11, 2018, 09:05:25 PM »
I wasn't running out of memory. It was being Really Weird about language codes.

Offline lskovlun

Re: Inventory problem
« Reply #17 on: December 12, 2018, 04:12:09 AM »
I wasn't running out of memory. It was being Really Weird about language codes.
But it was still triggered by something to do with the inventory:
Quote
I give up. I try to remove all but one of the inventory items, game won't start
It's likely some sort of memory corruption that causes it, but I've no idea why.

Offline amirkle

Re: Inventory problem
« Reply #18 on: December 12, 2018, 10:02:23 AM »

- what's the stack trace when the crash occurs?
- have you established that it's the addition of one more inventory item that's causing the problem, instead of that *specific* inventory item?

So many easy things you can do to help root cause the problem.

It's very weird... it's not that one specific item that causes the problem. the game crashes the moment i got a 39th inventory item in my inventory script. it works fine with 38 items (potential items, cause the game wont start at all with a list of 39, even when none has been taken on game)

im very sorry for my ignorance, but what is the stack trace and where can i find it?

also, how do i see my memory usage?

Offline troflip

Re: Inventory problem
« Reply #19 on: December 12, 2018, 02:31:12 PM »
im very sorry for my ignorance, but what is the stack trace and where can i find it?

also, how do i see my memory usage?

If you press ? while in the debugger (when the game crashes when using the debug-enabled interpreter built by kawa), it should pop up a menu of commands. One of them should be 's', which will show the call stack (or the 'send' stack, which is almost the same).

There should be some commands to show memory information too.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: Inventory problem
« Reply #20 on: December 12, 2018, 04:32:58 PM »
If you press ? while in the debugger (when the game crashes when using the debug-enabled interpreter built by kawa), it should pop up a menu of commands.
Or it will crash because it can't load the debug help text, in which case:

q - quit

b - set breakpoint - object,method
B - set breakpoint - object,method (sticky)
<ctrl>B - clear sticky object,method breakpoint
n - set breakpoint - script,offset
N - set breakpoint - script,offset (sticky)
<ctrl>N - clear sticky script,offset breakpoint
R - break at the next return

C - clear all breakpoints and exit debug
D - exit debug
` - toggle debug

Enter - single step
Tab - step across send

a - inspect ID in accumulator
c - inspect current object
i - inspect object or memory
d - inspect hunk address

f - show free heap
s - show sends
r - show resource types
o - show objects in heap
O - show objects w/ addresses
S - show stack usage

g - edit global var
l - edit local var
f - edit frame var (temp var)

i - inspect selector
e - edit heap address or selector
t - trace heap address or selector
T - trace hunk address

c - display collection

left, right arrow
  - move address by 2 bytes
up, down arrow
  - move address by 16 bytes
pageup, pagedown
  - move address by 64 bytes

[ - move to next in doubly-
    linked list
] - move to previous in
    doubly-linked list

Offline amirkle

Re: Inventory problem
« Reply #21 on: December 13, 2018, 03:47:42 AM »
ok, that's the one. couldn't get the info regarding memory usage though, not by pressing "i" for memory indicator at least...

got any thoughts? does that stack trace tell you anything?

Offline Kawa

Re: Inventory problem
« Reply #22 on: December 13, 2018, 05:25:55 AM »
It still can't name the method...

Offline troflip

Re: Inventory problem
« Reply #23 on: December 13, 2018, 12:53:05 PM »
Maybe there are too many parameters in the send call when you're adding items? Send/self/super calls put a sequence of values on the stack, of the form:

Code: [Select]
selectorNumber numParams [param0-paramN] selectorNumber numParams [param0-paramN] ... totalNumberOfBytes

I'm guessing something is wrong somewhere in there and one of the parameters is being treated as a selector number (method call).

What does your templateInventory init method look like? More specifically, the self call when you add the items? What does the disassembly look like? (Script -> Disassemble).

Also, what's the size the size of the heap and script resources for this script? (script 15, I presume). Can you attach the script and heap resources to a post?
« Last Edit: December 13, 2018, 05:05:43 PM by troflip »
Check out my website: http://icefallgames.com
Groundhog Day Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.067 seconds with 24 queries.