creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
Development Forum
old
C2 - Wraparound fix attempt.   1 | 2
Elegnaim

Elegnaim



  5/15/2017

Since the old cob for addressing the wraparound point weirdness seems to be gone forever, or I'm just REALLY bad at googling for things...

Download Link

(Credits: The modified 4 0 0 28 script in this is based on the one from Albian Updates).

The basic idea behind this is that for all of the scripts in the 4 0 0 range that used appr, appr was replaced with something like this:

setv va20 posx
setv va23 targ
targ _it_
setv va21 posx
targ va23

doif va21 lt 4176
doif va20 gt 4176
doif va20 lt 7000
pose 60
trig 6 10 255
else
appr
touc
endi
else
appr
touc
endi
else
doif va20 lt 4176
doif va20 gt 1500
pose 59
trig 6 11 255
else
appr
touc
endi
else
appr
touc
endi
endi


The intent here is that if a norn is to the right of the world seam at 4176 and their _it_ object is to the left, they receive a "Hand Pushed Me Left" trigger instead of appr (and vice versa).

This seems to work (although I couldn't test it extensively, norn attention spans being what they are) insofar as norns can track moving objects past the world seam without getting lost/find the science kit and incubator area cheese, but I have a few questions.

1. Is there a better way to force a norn to walk in a given direction? The push trigger doesn't seem to be totally consistent/seems to get interrupted more readily than appr does.

2. I tried to compensate for the 0/8352 wraparound point by suppressing the updates if the norn is between 7000x and 1500x. I think the 0/8352 wraparound works normally, and if the creature's at 7000x or 1500x they shouldn't be targeting something past the 4176 wraparound. Not entirely sure if this is working correctly yet.

3. I'm not well versed in CAOS and all the nested doifs look messy to me. Not sure if there's a better way I should be checking multiple conditions.

 
GimmeCat

GimmeCat



  5/15/2017

THANK YOU for doing this! The loss of that bugfix has been a gaping hole in the completeness of C2's patchscape for ages.

As for the walk issue, you could try sending a stim writ 26/27 (extra left/extra right) instead of a hand push?

 
Elegnaim

Elegnaim



  5/15/2017  1

Played around with this some more and put up an updated version (should be the same link). A few interesting bugs:

1. The updated scripts made creatures a bit... telepathic. I think I needed a touc command after triggering movement in the decision lobes to stop them from interacting with objects they weren't actually near.

This issue's my biggest concern right now.

2. Creatures mostly seem to handle objects lying around in the world well enough with this. They're prone to shuffling around about near the wraparound, but they get past it eventually.

Trying to get them to follow the hand past the wraparound point is NOT working though. I feel like there's a script governing creature and hand interactions that I'm not finding. It's possible one of the official patches/life kits/Albian Updates dropped some more appr's in somewhere.

This isn't really a major concern though -- the wraparound glitch was more problematic in terms of creatures finding things on their own.

3. Not sure if this is my fault, but I've noticed norns walking away from stuff they're looking at in places besides the wraparound point. I thiiink this is maybe just a thing they do sometimes though, but it's possible the bit in the updated script that forces them left is also causing them to not stop.

 
Elegnaim

Elegnaim



  5/16/2017

Okay, I think I have this working now. Updated download link in the first post.

From what I gather, touc causes the previous movement macro to just keep firing until the creature touches their target or goes completely out of range of it. As such, trig 6 10 255'ing them was making them overshoot their goal and rendering it impossible for them to get back to it, and appr'ing them meant they couldn't retarget properly if their target crossed the wrap point.

Updated solution to this is below:

1. Check to see if ownr and _it_ are touching. If they are, do the rest of the script.
2. Do the same basic wraparound checking I described above.
3. Finally, don't try to actually touc anything unless ownr and _it_ are within 200 distance units of eachother.

Potentially you could still break this by grabbing something really close to a norn that was being targeted and moving it past the wrap point, but that's... a very specific edge case.

Only issue I'm noticing now is that sometimes norns shuffle in place a bit before getting over the wraparound point, but they're getting past it now, at least.

I haven't been able to test the creature-on-creature interaction scripts very much, unfortunately, and those ones are a bit weird.

I decided to stick to trig instead of stim. My understanding is that trig bypasses learning and I'm assuming appr does too, so I wanted parity there.

Also I do have some concerns re performance since a lot of conditionals were added.

Anyway, if this looks like it's working for other people I'll try to get it submitted to the proper download archive.

Possible Issues:

1. As noted above, if a creature walks past its target and ends up outside the range of being able to touch their target, they can get stuck in a perpetual left/right walk loop. Since I originally posted this, I bumped the touch distance up from 75 to 200.

This is actually still happening after I removed my scripts though so uh... Hm.

2. I still notice some cases where norns walk past what they're looking at, although I think this is just something that they do anyway?


scrp 4 0 0 17
impt 4
aim: 0

doif touc targ _it_ gt 1
gsub oscr
else
setv va20 posx
targ _it_
setv va21 posx
targ ownr

doif va21 lt 4176
doif va20 gt 4176
doif va20 lt 7352
pose 60
trig 6 10 255
else
gsub oscr
endi
else
gsub oscr
endi
else
doif va20 lt 4176
doif va20 gt 1000
pose 59
trig 6 11 255
else
gsub oscr
endi
else
gsub oscr
endi
endi
endi

subr oscr
setv va22 relx
doif va22 lt 0
negv va22
endi
doif va22 lt 200
appr
touc
wait 4
mesg writ _it_ 0
stm# writ targ 13
wait 4
pose 12
wait 20
done
else
appr
endi
retn
endm

 
GimmeCat

GimmeCat



  5/16/2017

I'll try and test it out in my game tomorrow. Good work!
 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  5/16/2017

This looks very promising, thank you for trying to fix this problem!

My TCR Norns
 
Elegnaim

Elegnaim



  5/18/2017

Updated a few things. Same download link in the first post.

1. The Seek script had the following lines added after the bits that cause the norn to walk left or right. These were originally after the appr command, so hopefully they'll stim the norn into thinking they're approaching their target.


impt 1
pose 12
wait 30
stm# writ targ 16


2. Dropped the distance before a norn starts appr'ing their target from 200 to 100, since the thing with norns walking past the object their looking at doesn't seem to come from my changes.

3. Added a modified version of MrNstuff's drop script. At that, is there any way I could dig up these old modders to see if they're okay with me incorporating their scripts? I'm only doing this for compatibility reasons but still :T

 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  5/18/2017

It's commendable that you want to see if the old guard is okay with you incorporating their scripts, but it has literally been 18 years since C2 was released. It seems to me, through a trawl of alt.games.creatures that it has long been 'a truth, universally acknowledged' that C2 is buggy as all get out.

My TCR Norns
 
Norngirl

Norngirl


 visit Norngirl's website: Norngirl's Temporary Storage
  5/18/2017

Sorry if this maybe is off topic or not related at least to the fix you make for C2,but is there any way there could be fix for the Vibraphone?
I noticed Norns aren't able to interact with it...
I also wonder if the Guitar toy is broken as well.

I know C2 have a lot of bugs and Im not sure if most are fixable,such as the game crash on third or more years passing ingame - but if able that would be a dream come true to make it fully playable!

It's nice to see you try hard on some of the bugs thought!
Yes I notice Norns seem to have a bad habit to walk away from objects they look at,some more than others and do not know if that can be fixed?

I also noticed this area where they refuse to walk to the left when they are close to the second springtoy you find near the lift going up to the science kit -perhaps a image shows better of what Area Im talking about Seen on this screenshot I found
-Yay finaly got the image link code to work-

Not even with Freyas bridge cob installed did they want to be encouraged to walk towards it.
Perhaps thats what you fixed?

If I ever get Creatures 2,I might give this update a try if possible.

 
Elegnaim

Elegnaim



  5/19/2017

From what I can tell, there's a steep edge near the spring toy that anything younger than an adult can has a hard time climbing.

So even with the wraparound cob, there's basically a ledge there they can't get past.

I think GimmeCat's map edits (Better Albia 1.1) fix it.

Don't think I've encountered the crash after three in game years? About how many hours is that? I'm going to run a wolfling run to kind of soak test the wraparound cob and some other stuff with the lifts I'm trying, so I'll see if I run into it.

 
Elegnaim

Elegnaim



  5/23/2017

Okay, not sure if this is an issue with my wraparound fix cob or with my room boundary setup or possibly just the game, but I've noticed that if norns stand around the foreground wall just to the right of the science kit pickup, they experience a *ton* of pain.

Anyone experiencing anything like this?

 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  6/2/2017

Does this go before or after Better Albia, when I install it?

My TCR Norns
 
Elegnaim

Elegnaim



  6/3/2017  1

Install Better Albia first.
 
Yme

Yme



  3/31/2018

I'm going to check this COB out now.

Did it get finished, or are there unresolved issues with it?

 
Elegnaim

Elegnaim



  4/3/2018  1

I'm assuming this is done and there are no other issues with it.

1. Sometimes creatures get stuck on the wraparound point and shuffle around for a bit before getting past it, but this still seems to work better than the whole tearing off in the opposite direction thing ;)

2. The pain issue I mentioned is... I THINK from something with the floor/ceilings defined on the map. My mod just pushes norns which shouldn't cause pain?

 
GimmeCat

GimmeCat



  4/15/2018

After some investigation, there doesn't appear to be any issue with the rooms or floors themselves. I suspect there is some sort of conflict happening due to the rooms in that location being slightly resized.

If the wraparound point is defined as being at x4176, then perhaps the room edges now existing along x4163 instead of x4176 is what's causing the problem?

In my current world, using both the wraparound fix and BA, my norns seem to hit an invisible wall right down this line which is consistent with the new room edges.

Edit: The originals don't even align to x4176. They align to x4183. Curious... well, there goes my main theory. :( But perhaps the fact that the newly resized edges fall below the wraparound point (as opposed to above it) could still be something to do with it.

Edit2: Further investigation shows this pain issue exists in completely default worlds (2) without either the wraparound fix or BA installed. My current opinion is that this is a game engine bug and neither of our mods are to blame. Sadly, neither do either of our mods fix the problem...

 
GimmeCat

GimmeCat



  4/15/2018  1

(Double-post to keep this coherent)

Interesting discovery, after completely deleting the elevator shaft rooms and instead connecting the room to the left to the room to the right:



The Ettin walked from left to right, encountered the (very mild) slope, and was slid at quite high velocity towards the right room boundary. It got stuck in this screenshot because I didn't set up the room neighbours properly, but after fixing that the same thing happens-- it slides bumpily down the slope, unable to stop until it hits the room edge, at which point it carries on its way (having received a massive dose of pain).

Edit: Even having flattened the floor in that area, the Ettin is still pushed to the room's edge. So it's not a floor slope issue.

 
Yme

Yme



  4/15/2018

That's so strange... There's something fundamentally wrong with that part of albia, it seems. Something deeper in the game engine, that isn't directly tied to room layouts.
 
GimmeCat

GimmeCat



  4/15/2018

Yeah. I just don't understand why the Ettin Temple room doesn't suffer the same problem. It's only those rooms under the desert.

Although, even down there and even with the wraparound fix, nothing seems able to properly navigate from left->right past the seam. Right<-left works, though.

Edit: Looking at the wraparound fix scripts. I'm not currently understanding the decision to check "lt 7352" rather than 8352, and to have that 1000 pixels area leftover as a seperate check. That area seems to fall over the dark ocean, which is nowhere near the seam.

 
Elegnaim

Elegnaim



  4/15/2018

iirc I have some checks that make sure the norns are within range of the wraparound point before triggering my updates. I think because of how the math works out I need to do some separate checks around the blue ocean for something. That was a year ago so I don't entirely remember though :S

I kiiind of suspect a correct, but really, really annoying to do, fix for the map data would involve:

1. Shifting the map image around so that the original wrapping point on the background graphic (ie roughly the middle of the volcano. I think where the black line is on this: http://www.oocities.org/heartland/acres/2933/c2albim2.gif) corresponded to where the actual wrapping point was in the game.

2. Doing the same for every single room.

Point 1 wouldn't be too bad but I have no idea if there's a quick way to move rooms around in the existing world editor.

I've got a suspicion that the wraparound point in the world proper originally matched the wraparound point on the graphics. If something in the engine is hardcoded to look at that, maybe it's trying to grab data from the volcano area? Do norns experience a sudden heat increase when crossing the seam left to right? I've never checked it.

I feel like it's the pain increase that's keeping the norns from correctly navigating from left to right here and not the wraparound point itself. The wraparound glitch happens when they're following something across the seam. If they're just looking at themselves and moving right it shouldn't trigger.

Maybe relevant to this is that even with your map fixes, things get stuck wallbonking on the right edge of the volcano.

 
GimmeCat

GimmeCat



  4/15/2018

That solution sounds like hell. :P Not only would you have to move all the rooms, but all the objects as well-- including multi-part machines, elevators, scenery, sounds...

The issue I'm seeing with them unable to go left->right is that they can look at the object just fine, but when they try to approach it they take a single halting step and then stand looking at it. No amount of coaxing gets them to approach the object from the left, but they can approach from the right just fine.

I was looking all day today for a way to completely disable the game's "push the creature away from the wall" function, but I'm almost certain now that it's a hardcoded behaviour. You can edit out the pain from the genes, and the anim from the colission script, but I couldn't find anywhere that controls the actual 'shove' that happens. Even with cheatengine!

So frustrating.

 
Elegnaim

Elegnaim



  4/16/2018

Any idea if world files have any sort of compression or encryption on them? If I feel bored/energetic this weekend I guess I could try to write a program that would shift stuff around programmatically.

Still take some time to do but it'd be repeatable and not prone to human errors.

 
GimmeCat

GimmeCat



  4/17/2018

Honestly I don't see that as solving anything. I'd bet anything that they wouldn't have put the seam in the middle of the world if putting it at the edge, where you'd expect it to be, worked any better.


That said, I don't think so. You can straight up hex-edit world files to replace e.g. background sprites and whatnot.

 
Elegnaim

Elegnaim



  4/17/2018

Moving it to the volcano would cause the seam to align with a bunch of empty space where norns would never be anyway, basically!
 
Yme

Yme



  4/18/2018

I'm pretty sure that's where the "real" wraparound point is. I remember creatures having problems there, when the game was first released, and one of the patches fixing it.

I am not sure if the one we are talking about now, was a problem back then, or if the patch simply changed where the wraparound point is.

I've noticed that the game world has some very odd rooms, though. Based on my absolute lack og knowledge on how to fix stuff like this, maybe cleaning up the strange small rooms, will help fix this? Above the blue ocean, at the very top edge of the map, there are 2 very small rooms. Maybe making that 1 room, and going through the entire map looking for odd stuff like this, might help with the wraparound problem?

 
Yme

Yme



  4/18/2018

If the wraparound problem was located at the room edges that go in a vertical line, from the right edge of the bottom of the volcano and up, the only place where Norns would have problems, would be at the small beach with the coconuts.
There would be a problem for them at the little passageway between the volcano and hall with the burner etc, but these to points are insignificant compared to the problems the wraparound are causing where it is now.

 
GimmeCat

GimmeCat



  4/18/2018  1

The problem with removing too many rooms is that you risk messing up the ecosystem balance. Some rooms act as heat/light sources and others act as sinks, so the world never heats too far up or cools too far down. This relationship between sources and sinks is also what generates wind, which rainclouds use to pick up moisture from the oceans and precipitate over the land.
 
Yme

Yme



  4/19/2018

GimmeCat wrote:
The problem with removing too many rooms is that you risk messing up the ecosystem balance. Some rooms act as heat/light sources and others act as sinks, so the world never heats too far up or cools too far down. This relationship between sources and sinks is also what generates wind, which rainclouds use to pick up moisture from the oceans and precipitate over the land.




I had no idea the ecosystem was that advanced :O Does this affect anything else in the world? I know that some plants, like the pear, is seasonal, but I thought that was just scripted... And it's only the pears, and the fruit on the big tree house, as far as I can see.

Is this one of the things they put in, but didn't fully realize?

 
GimmeCat

GimmeCat



  4/19/2018  1

Yes. Heat is really the only important thing in general, and then only really matters for creatures. Most plants only check their room's inorg/organic soil content and not the weather.

Heat is checked by icebergs, rain/clouds, the 'cloud machine' (that generates clouds), Puffball spores, and carrot/potato roots.

Wind only affects rain/clouds, the Windsock object, Striped caterpillars and purple butterflies (but no other catterpillar or butterfly varieties, strangely...) and Trumpet seeds.

Pressure only affects clouds.

Light is only checked by the Light Green and Dark Green cactus seeds.

Nothing at all checks for radiation.


Interestingly, while gathering this information I found that there is a script that regulates heat and pressure in the current room. The script is attached to an object, though, so it must be a localised effect. I went looking in the world for this invisible object and found a single instance of it located here:




So... yeah, they didn't really get far setting this up properly. :P

 
Yme

Yme



  4/19/2018

It's too bad they weren't able to fully implement this, as it would have bin pretty cool if the world was fully detailed like that!

I really need to learn coding, as it would be so awesome to fix all of this up :D Sadly I have absolutely zero experience with anything like that.

Oh, and you know the bell things, down by the frog pond? If a Norn tries to look at it, it automatically looks at pressure thing you found, in the sky there. That's why they are unable to play with the bells, and when they try to interact with it, they walk towards that thing in the sky, and fal into the pond. Very strange bug!

 
GimmeCat

GimmeCat



  4/19/2018  1

This may or may not be useful to anyone, but I thought it worth sharing here if for no other reason than to have it recorded somewhere.

After some memory-snooping I discovered a few useful addresses, including one that appears to be the x-width of the world.

Setting 004817fc to a larger value creates an additional wedge of space to the right of the volcano with no background sprites defined, so rendering there is a little wonky.

Similarly, setting it to a smaller value literally shrinks the world, such that if you do it on a default world it will cause script errors from the objects that suddenly find themselves in null locations.

I didn't have time today to see what instruction in the game's exe sets this value, but if I can find out it might go some ways towards a possible code patch in the future?

Caveat 1: Room and object coordinates still appear to think it goes up to 8352, and I'm sure there are other addresses for that I haven't yet discovered.

Caveat 2: Hacking a world file to only load up half the number of Back.s16 sprites is surprisingly difficult. I'm still experimenting with this, but the long and short of it is that at 0x2b is a two-byte variable stating the number of sprites in Back.s16 (928) and then from 3b onwards are exactly 928 15-byte records specifying each sprite file to be painted into the world. The problem is that I've had mixed success changing these amounts and the game tends to 'fix' the data by reloading it from Back.s16 if it thinks it's become corrupted.

As for the other addresses I mentioned earlier,

00475290 = y camera scroll amount
00475294 = x camera scroll amount

The x one is 4176 with the 'infinite scroll' powerup, and 400 without.

01EA6994 = powerup toggle (1 = on, 0 = off)

That's all I got for now.

 
Elegnaim

Elegnaim



  4/20/2018

Whatever happened to Creatures 2 to DS anyway? I'm wondering if it might be more productive to just hijack that and finish it, but I have no idea if the source or whatever is available.
 
GimmeCat

GimmeCat



  4/21/2018

DS is a very different game, even if the graphics and whatnot are ported over. But if that's what you want to do, go for it.

I guess that will just leave me on the C2 front, then. :( I don't think I can get too much further with the assembly hacking. I'm not a programmer by any means. But I did have a crazy idea for a workaround that I might one day get to. It would be pretty ugly though.

 
ylukyun
Patient Pirate

ylukyun

Manager



  4/21/2018

GimmeCat is right. It's a completely different game, and working on C2toDS is not really a substitute for fixing C2. It would also require a different skill set. That being said, if you're interested in working on the C2toDS project (which I'm sure could use your help), your best bet is to contact Liam. He's still around from time to time, albeit very infrequently.
 
Elegnaim

Elegnaim



  4/21/2018

I tried reproducing the pain issue with a baby norn in a totally default world and it wasn't happening. Does this only affect adults or something?

(I think my biggest issues with C2 are that norns can't learn to refocus their attention based on their drives and they can't recognize individual norns are really interact that much. These don't work *well* in C3 but afaik they're fixable there. I don't think they're fixable at all in C2. The attention thing in particular really hampers survivability from what I've seen).

 
skerit

skerit


 visit skerit's website: Skerit
  4/21/2018

GimmeCat wrote:
DS is a very different game, even if the graphics and whatnot are ported over. But if that's what you want to do, go for it.

I guess that will just leave me on the C2 front, then. :( I don't think I can get too much further with the assembly hacking. I'm not a programmer by any means. But I did have a crazy idea for a workaround that I might one day get to. It would be pretty ugly though.



I tried C2toDS a few weeks ago, with C2 norn sprites.

Even though it looked awesome (the "albia at night" bit is beautiful), it was quite jarring to see the norns running around like wild animals, pushing every button in sight, taking every elevator up or down, ... the norn behaviour was off-putting. They were like ADHD norns.

So that taught me that there is some beauty in the stupidity of the C2 norns :)

Anyway: interesting findings, @GimmeCat! I would like to do some digging, too.

Does anyone know if the first release of the game did indeed have a different wraparound point? If so, it could be interesting to compare the executables before & after patching.

 

prev | 1 | 2 | next

downloads
cobs
adoptions
creaturelink
metarooms
breeds
 
gallery
art
wallpaper
screenshots
graphics
promos
sprites
dev
hack shack
script reservations
dev resources
active projects
dev forum
 
community
links
advice
chat
polls
resources
creatchi
 
forum
bookmarks
general
news
help
development
strangeo
survivor
mycaves
log in
register
lost pw
1 online
OddFerret
creatures caves is your #1 resource for the creatures artificial life game series: creatures, creatures 2, creatures 3, docking station, and the upcoming creatures family.

contact    help    privacy policy    terms & conditions    rules    donate    wiki