SimAntics & World Development (archive)

Discussion in 'Development News' started by RHY3756547, Feb 16, 2014.

Thread Status:
Not open for further replies.
  1. ddfczm

    ddfczm Administrator Staff Member Moderator

    Cool, makes sense. So that covers interactions but what about main loops for objects like the aquarium animation. Does the stack object ID start out as 0/NULL or does it use the same value as the My pointer?
  2. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    I'll give that a check right now. It's worth noting that in The Sims Complete Collection performing an illegal operation resets the object, so performing an illegal operation in init completely freezes the game. :p
  3. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    OK, The stack object defaults to null on executing an entry point (dialog shows it called $Object), which is why it needs to be set to My object id in init and main to be able to use the globals which affect the stack object (eg. Global::set object graphic).
  4. ddfczm

    ddfczm Administrator Staff Member Moderator

    Heh, its a shame there aren't better ways to get a view into the VM memory in TS1. I found it annoying to have to execute primitives, branch and then dialog to test numbers. Luckily most of the primitives make sense I guess and having a view of VM memory wouldn't help with the more complicated prims like character routing / walking.
  5. ddfczm

    ddfczm Administrator Staff Member Moderator

    Cool, so that's a nice clear picture now :). What's your thoughts on OBJDs having 0 for init/main/load BHAVs? Replaced by something else we haven't seen yet? Maybe they moved to well defined IDs / names or maybe its just info the server had and the client does not requiring a little manual table to be created for every object. At least they are well named.
  6. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    They're replaced by OBJf tables when "UsesFnTable" in the OBJD is 1. I've implemented them in my local copy.

    I've set up a system to generate a function table from the OBJD if an external one isn't present, so they both have the same function table setup. There are a few IDs missing though...
  7. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    All objects on restaurant job 1 now run their init functions without crashing, thanks to the addition of SemiGlobals, global tuning and fixes to the stack object. Also, the stack size isn't a hard limit, as the refrigerator decided to prove :( So we'll need to make stacks either a List<VMStackFrame> or regenerate the array upon exceeding the size. It was called "initial" stack size anyways :p
  8. francot514

    francot514 Well-Known Member

    Can you show images about progress, or youre talking about results what you get when debugging....
  9. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    Can't really show images of the objects correctly initing (since most of them look the same) - though the aquarium is successfully empty on lot start. Right now restocking isn't working. :(
  10. ddfczm

    ddfczm Administrator Staff Member Moderator

    Restock used to work. I'm guessing its broken by the change to using numeric arrays for variable storage rather than handled individually? I think its a worth while change tho, its important for fast serialization. I had left them individually addressed on purpose so I would throw an exception when something was accessed I had not implemented yet but that's just a debugging preference, needed to be arrays sooner or later.

    Out of curiosity how do you intend to handle specific object variables that have behaviour when they change? Some sort of funnel function may be nice onVariableChange(id, value) or something like that, something the Null implementation can ignore.
  11. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    I removed the specific handling in VMGameObject in favor of setting the graphic as a normal read/write variable then using Refresh(my/stack object) to change the graphic and it seems to be working now (albeit only when I move the camera).

    For specific cases right now I have a small switch above the indexed Object Data access. It only contains Object ID right now, but when more cases arise I'll add them. My betting behind indexed arrays for everything is mainly because (specifically for object data) most of the fields look like simple SimAntics read/write only without any VM intervention. There are the odd few that don't, though, which do need to be accounted for.

    Right now the sim seems to accidentally play an animation when trying to reset, and a few other things (stop carry animation tries to load animation), so I'll look into reimplementing that with the revised events stuff now.
  12. ddfczm

    ddfczm Administrator Staff Member Moderator

    Lol, this is the time to start keeping a blooper reel. Last time I tried to run restock the bag of fish stuck to the sims hand forever more :)
  13. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    Yep, that's one of the things that's happening to me. :p Hopefully should be fixed when events are patched up, and the sim will stop angrily disagreeing with every interaction when reset is fixed.
  14. ddfczm

    ddfczm Administrator Staff Member Moderator

    Haha i love that he's angry about everything. Just like real life
    RHY3756547 likes this.
  15. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    Fixing up the Animate Sim primitive fixed:

    - Tank now stops being dirty at correct point in animation (working events!!).
    - Certain animations no longer play at half speed
    - The sim no longer has a distaste for every interaction :p
    - Restock now works perfectly - the bag is actually inserted (disappears from sim's hand) and the fish revive!

    By the way, are you accounting for the root bone correctly? It seems the sim is jittering about with a lot of the animations.
    Last edited: Feb 27, 2014
    Tori Sim likes this.
  16. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    OK, I committed all my changes so far.

    If any of you want to check it out, check out the latest code and compile. The interactions that are guaranteed to work are:

    Aquarium: All prefixed with Interaction than doesn't have TEST at the end (main function enabled on this object)
    Sinks: Interaction - Wash Hands

    Some others might work, but most of them require SLOTs or create objects or other fun things like queue interactions on other objects. Aquarium feed fish still has a bug where the fish start responding to the sim feeding the fish but the sim thread is frozen...

    ALSO! Aquarium clean has an exciting mega-fun chance (not sure of the chance, but it uses the random number primitive to determine whether to flood the place) to crash the game by attempting to create a pool of water on the ground. This will not work as not only have I not implemented Create Object Instance - I have also not implemented queuing interactions by name onto the stack (which it does before creating the flood)!
  17. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    About my root bone suspicions:
    The Watch Fish interaction shows the sim kind of sliding across the ground when crouching down at the start, however you can see here that the sim doesn't budge at all with my javascript renderer... (feet dont slide)

    https://dl.dropboxusercontent.com/u/12239448/vitaboy-webgl/index.html

    I'll need to take a look into vitaboy to see what you guys are doing differently. I noticed it most prominently in the video Darren posted a while ago involving kicking the flamingo, it looks like he's on ice. :p
  18. aidancheddar

    aidancheddar Active Member

    Who knew a fish tank could be so fun. xD
  19. aidancheddar

    aidancheddar Active Member

    [​IMG]
    Eat your heart out, EA. X)

    Btw, this thread should be stickied.
    Tori Sim and heat33330 like this.
  20. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    Currently working on the sim main thread - there's an infinite loop in reset_temp_behaviors for some reason... (no idea why, it's completely linear)
    aidancheddar likes this.
Thread Status:
Not open for further replies.

Share This Page