—    —  Home

   JLJac on October 04, 2014, 05:33:55 PM:

Yup, parallel. The shadows are created with a pretty simple mechanic. As the level is rendered, is saves the depth of each pixel, ie how far into the Z dimension it is.

Now we're in the shader, and we're rendering a pixel P.

What we need to do is find a... let's call it shadow check coordinate S.

S is to the left of and above P. How much to the left and above increases linearly with the depth at P.

So if P has a depth of 6, S might be 6 pixels to the left and 6 pixels above P. (Except it's actually scaled by a factor in the actual game, and can have different angles that are not necessarily 45 degrees)

When we have S we do a check whether or not coordinate S is occupied by any sprite. If yes, then coordinate P should be in shadow.

What this essentially means is that if a wall is far behind the play layer, the shadows will appear far down to the right of the sprites. If the wall is close, the shadows will appear close to the sprites. But it's on a per-pixel level, meaning that she shadows can be distorted by different shapes in the background.

Simple as that! If you want to do some digging through the thread I think I did this stuff back in May, so there are more details to get there  Hand Thumbs Up Right





   JLJac on October 04, 2014, 07:49:39 PM:

Yeah, it's all done from scratch. I'm using Unity to handle input, it has a very convenient framework where you can just ask if a button is pressed. Also I use the unity engine for some extremely basic stuff such as float maths and random numbers, but I think there are probably a million libraries for that, so it's not really Unity specific.

The main reason why we're in Unity to begin with is to use its graphics engine to render sprites through the Futile framework. But that's some pretty basic stuff as well, importing a graphic, declaring a sprite that uses the graphic, that kind of stuff. And I have been digging a tiny little bit into that as well, doing customizations, for example the tails of the creatures are a custom version of the Futile FSprite class.

So yeah, I haven't touched the Unity Editor and it's all written in C# from scratch. That is cool and all, but it comes with its problems. For example I have my own home brewn "physics engine", which is not the best all of the time for all scenarios. So, pros and cons. Because on the other hand, if there is a problem in my code, I can attempt to fix it, as the entire code is accessible to me.

If I got a fresh start at making games, I'd probably not try to learn how to do everything myself though! I think you can achieve really cool results way more quickly by using for example the Unity Editor and presets. It's probably a way more efficient work flow, and the code doesn't end up an obscure nightmare haha!





   JLJac on October 05, 2014, 05:47:08 AM:

Yeah definitely. The ones shown are the standard palettes, and in those I want to keep the shadows from being distracting - but when the game gets some more areas that are focused more on mood rather than action, there'll be palettes with much greater contrast between light and shadow, so you really can't miss it!





   JLJac on October 05, 2014, 02:39:35 PM:

Not that it makes any difference, but x^3 and x^4 are still polynomial. Exponential is e^x or 10^x or anything^x

Oops! I never took maths after ... ugh school systems ... upper secondary perhaps? So I really don't have the faintest what I'm talking about o.0 Thanks for the correction though!

The gif is just a work in progress that looked interesting but was never used. What you're seeing is a dijkstra map being generated with a completely random next-tile-to-expand-heuristic, and as each new tile is added it traces back to the origin point and increments the values along the way, creating the tree-like structure.

I say 200kb per map is OK. That's what, 10-100 megs of RAM for the whole game, considering this will probably end up being the most memory-heavy part of it?

The performance question I'd ask is "will all that data (for the currently loaded map) fit in cache?". And even if it won't fit, nothing you can do about it. You can't compress data for cache, that's like disassembling half your car so it can fit in a parking space closer to home.

Programmer time is the most precious resource, don't hesitate over optimisation: that's what profiling's for.

Then again, you're the guy with your own company, I'm just a chump who hasn't used c++ in 4 years, still hasn't learned the modern opengl pipeline, and never started his own game. Take everything I tell you as personally untested but comforting-sounding hearsay.
Not all rooms will be loaded at the same time, so this is probably not going to be a problem at all. It's just that it'd feel kinda weird to release a pixelly retro platformer that's 30GB big and requires a monster of a computer, haha.

I guarantee you that my chumpness trumps yours! I'm just a kid to whom a kickstarter happened, and I have no idea what I'm doing. But things seem to be going good enough so far, touch wood!

So you're not limited to just floor and backwall shadows! Nicely done! I'd love to see some more complex background shapes.
Unfortunately, for my own game, I can't afford going per-pixel like this. I tried to implement dynamic shadows today in the most efficient way I could think of, and yet it still fell flat on its face at ~30 fps. Guess I'll have to stick to static shadows. I'll give that earlier material a read, though.

Edit: oh, and thank you, of course, for replying! I really appreciate it!  Beer!
Technically I'm actually limited to only back wall shadows, but all surfaces are built out of several layers of back wall Wink I think that if you're doing anything per-pixel, it has to be done in a shader. If you do that stuff on the processor, it's just too slow. Oh and you don't need to thank me for bragging about my game haha!   Crazy





   JLJac on October 06, 2014, 12:38:55 AM:

Thank you so much everyone! Really means a lot to know that the tiny little details I spend hours on are actually noticed!

Answering a few questions -

No UI won't be a new game + feature, because it's the default mode. Maybe we'll have something like that you can hold down a button and see how many flies you've caught so you don't have to count them, but we're definitely aiming for an entirely clean screen during gameplay. Inverted RW, heheheh, idk... really breaks canon, that one. But if it's fun it could be included as a secret or something.

Shortcuts - yes, super unclear where they lead at the moment. They are not graphically finished to look like they did in the lingo version, where it was a little clearer because they had little arrows at the entrances and the actual shortcut consisted of black somewhat visible dots, but even back then it was hard to know. This one definitely needs some thinking.

Environments - nope, I've decided that the environments are going to be completely static. A bit boring, I know, but it was a sacrifice I had to do in order to have the shadows. Also it would have been a technical nightmare. The third reason is that as it's only me doing animation, it feels reasonable to focus the energy on creature animations. If some flower wiggles as you pass it that might be cool, but it can never convey personality or narrative like creatures, so it feels like more bang for the buck to put my hours there.

Update 322
Now when everyone is excited about the latest kickstarter update, I take the opportunity to do boring stuff! Sneaky like a ninja!

So today I fixed some lizard-getting-stuck scenarios. And made blue lizards able to climb slopes that are in the ceiling. Maybe when James wakes up he can undo some of the boring by posting one of the gifs that didn't end up used in the kickstarter update - where there any cool ones, James?





   JLJac on October 06, 2014, 02:19:21 AM:

That could be added, but I think I won't, because it'd be inconsistent to have some such things be static and others be interactive. You never know though, if there is some way to do it stylistically in line with the rest of the game... As for whether all environmental components are in the game - if you mean stuff like plants and chains and other such decorations, of course not! Lots to be added when we get to the Art Phase.





   JLJac on October 06, 2014, 04:34:23 AM:

Ah! Yeah ok so with that stuff I'm preeeetty happy to keep it simple - I'd rather have a few solid, understandable components and then use creatures to make it interesting. That said we plan a pretty big game world, so it would be weird if not one or two more environmental elements like that snuck in. But it's not going to be a huge plethora of tile types, rather tiles will be kept pretty plain to set the stage for a plethora of creatures.





   jamesprimate on October 06, 2014, 04:02:35 PM:

Nice, some Rain World coverage on Rock Paper Shotgun!
http://www.rockpapershotgun.com/2014/10/06/rain-world-new-engine/

ah thats awesome theyre even paying attention to updates! i dont have the heart to correct them on the game maker thing, but fortunately commenter doomlaser knows whats up!  Hand Metal Right





   JLJac on October 07, 2014, 01:03:00 AM:

GifCam!

Update 333

Lizard strikes!





There's quite a lot going on here. In the morning I did the crouch-and-strike behavior you can see, which is also graphically communicated by the head turning black as they're charging. This is intended to look cool, but is actually mostly a liability to them - if they try this against a moving target they'll most likely miss, and even though the lunge itself is fast there's the charging and a speed penalty after as well, making the net speed gain negative in most situations. The lunge is a little bit different between breeds, the green one has more of a bull rush, and the blue one has something akin to a proper jump which it only uses very occasionally (as it's a pretty safe bet it'll result in falling to death on any level without a floor).

The great technical challenge of the day was something you might not expect though - placing the slugcat between the jaws of the lizard. Now there's a huge complex system in place where a graphics representation can contain sprite containers as well as sprites, and a system for moving objects into and out of those containers. So the lizard has essentially an entire sprite layer between its upper and lower jaw, and when the player is bitten every player sprite is moved into that layer, while still being moved around by the player object.

These Futile sprite containers also nest, which is pretty cool - in theory I think a lizard could be biting a lizard which is biting a lizard which is biting a lizard...

Now that the system is in place I think it's going to be pretty easy to implement similar stuff for other creatures, so if a creature is supposed to eat another, or contain an object nested in its sprites in some other way, there's a framework for that. One creature can even have several sprite containers, why ever they'd need that. Maybe something with two grabbing hands or something similar.





   jamesprimate on October 07, 2014, 01:11:25 AM:

Good lord! That is brutal!





   JLJac on October 08, 2014, 12:46:20 AM:

Thank you thank you thank you thank you! I'm really pleased with how things are coming together as well Smiley Keep in mind though that I hit record until it looks good - there are some ultra wonky or problematic recordings before I get a really good one, so there are still problems to sort out before the game looks good every time.

Jamming lizard mouths open - yeah, the idea has come up a few times, and I do like it. It's a really classic trope, putting a vertical stick in the mouth of some beast. But gameplay-wise I'm not so sure ... like, if you have the spear, why wouldn't you just want to spear it? And if you could do both actions, how would the game know which one you wanted? I'm not introducing a new button for that specifically, and it could get annoying if there was some context sensitive thing going on that didn't always line up with your intentions. We'll have to see if a natural way to implement it shows up.

Update 334
The goal I set out for today was making lizards carry their prey back to their dens, but that led to a million other things, so now I'm just generally sorting out all sorts of stuff with that original goal in the back of my head. Mostly I've been doing stuff that has to do with creatures carrying other creatures. Making it work with shortcuts was somewhat tricky, as well as having it happen between rooms, but those issues are sorted out now.

I've started on a framework for creatures carrying other creatures in abstract space, which might be pretty cool. For example it means you might be able to enter a room and see a creature carrying another, or have a creature pass through your room with some prey already in its jaws, disinterested in you.

To me personally I think this is the most interesting aspect of Rain World - the "terrarium" or living world aspect. The player is a main character in the way that the simulation is run at a finer granularity close to where the player is, but the entire world will be alive and eventful all the time, if you are there or not. This is obviously going to be hard to make into a balanced game, but we'll try, haha. Dwarf Fortress has a similar philosophy and works pretty well because the game isn't about winning, but about the stories that develop through the unexpected interactions. We can't really fall back on that as much because Rain World is more of a traditional game that you play to win, but also we have astronomically fewer moving parts than DF. This is a balance issue we'll really have to give some close consideration though. Any way I'm really excited that we're getting closer and closer to having the eco system simulation up and running.

One thing that hints that the dynamic food web is getting closer is a little test I did today. After having tested the lizard biting behavior exclusively on the slugcat, today I fired up a green and a blue lizard and told the green one that it finds the blue delicious.



Everything connected flawlessly. The bodies connected, the blue lizard was not allowed to move, it was placed between the jaws of the green lizard, green can grab on to any of the body chunks and keeps its grip there, even the terrain impact bubble effects showed up to give the scene some extra flavor. I'm really hoping this isn't becoming too brutal, I'm not intentionally trying to make it dark and gritty, I'm just implementing the mechanics and this is how it happens o___0

The point is this though; any creature can eat any creature - it's just one line of code in the relationship declarations away. In the old version something like this would have been a two day nightmare, if not impossible. It's going to be so much fun when we have more species running around!

Edit: This works equally as well apparently :D A bit over the top shaking for such a small prey perhaps ...



Note that I'm not intending to have lizards hunt flies, I'm just trying my "anything can eat anything" setup Wink





   JLJac on October 08, 2014, 05:47:17 AM:

That's a really good point ~ I did lower the effect of the weight of the carried creature quite some because otherwise it looked awkward when carrying around the slugcat, but yeah, the blue lizard should be a bit heavier. Maybe I can do some polynomial thing which makes low weights be really low but higher weights increase steeper than linear progression.





   jamesprimate on October 08, 2014, 04:48:52 PM:

give us the  Hand Money Right Hand Money Left Microsoft!

our plate is already pretty full with platforms, but down the road obviously the more places you can play rain world the better. first things first though: make actual game





   JLJac on October 08, 2014, 05:18:12 PM:

Could someone with some programming expertise help me out here? I'm having some weird frame rate dips if I add a lot of lizards that have relationships to each other (smooth if they don't) and I want to know what's going on.

Unity's profiler says that 98% of the processor power was spent on "RainWorldGame.Update" which is about as helpful as a physician telling you that "Yes you are sick" -.- So I tried using Visual Studios profiler and attaching it to Unity, and everything was really complex in there so I got confused for a while. Then I noticed that the one thing eating all the processor power was something called mono.dll and after trying to research a little bit I kind of think that this is my entire game baked into a single file... Meaning I have the same problem again. I want to profile inside my solution.

Building the project as a stand alone and profiling that doesn't seem to work either - it still just refers to mono.dll. The function in mono.dll that's called a million times is actually mono.dll, does this mean I have a call stack problem? Some recursive stuff going out of hand? Or is it just that because all my game logic is recognized as mono.dll?

And Dear Visual Studio Wizard, when you are reading this, please also tell me why the VS debugger refuses to stop on exceptions? It does stop on break points!





   JLJac on October 08, 2014, 07:02:59 PM (Last Edit: October 08, 2014, 07:37:36 PM):

That might be it ... but the point isn't as much this specific problem (I probably could hunt it down manually if I really tried) but that I want to be able to profile my game for the future. It can make the difference between finding some weird frame rate issue in 3 hours or 3 minutes. So even if I could do the 3 hours approach right now, I'd rather think about the long run.

Edit: My problem looks similar to this, so maybe the issue is that I don't have the symbols, whatever that's supposed to mean. Haha I've really been trying to find out what those "symbols" everyone in VS debugging is talking about is, but... Wikipedia didn't really help me this time ...





   JLJac on October 09, 2014, 04:07:25 AM:

Sorry, no update today. The morning I spent talking to James (and we did sort out some pretty important design issues, so that's a big step forwards!) and the rest of the day was mostly trying to get Visual Studio to comply. At the end of the day, I had managed to make it break on exceptions, but still not take me to the code for proper debugging.

@DarkWanderer, yeah, we've been thinking about having some corpses as distractions, and it would definitely be a cool mechanic. The question is whether we want to introduce dragging corpses around - it might make the game tedious to be dragging heavy creatures after you half the time. As for attacking injured creatures, that's a really good idea - I think it could be implemented pretty easily by having the creature's "scaryness" variable go down with its health. That way some creatures might perceive a specific other creature as scarier than delicious - ie not worth it - until its health drops, and the utility comparer suddenly gives a positive for hunting.

@Sebioff, THAAAAAANK YOU, that was the trick! I had clicked on that thing, but while the game was running or something I guess? So when you tipped me off I went back and tried again, and it worked! Also thanks for the article on symbols, now I actually get it! :D :D :D I guess I'll run Unity for profiling and keep monodevelop up for breaking on exceptions, and then edit my code in VS. One day I dream to do it all in one tool, but now I'm fine with whatever works for a while haha.

In case anyone was interested, the frame rate dip was because of the blue lizards fleeing from the green ones. As blue lizards are wall climbers, they have a lot of tiles that are accessible to them but that are not accessible to the greens. Every time they tried to evaluate a tile like that for how dangerous it is, they'd try to ask for the tile closest to that one which was in fact accessible to green lizards. The Find Closest Accessible Tile To This Creature method used a spiral - like, I'd start at the specific tile you wanted to get close to, and move in a square spiral from there until I hit an accessible tile. That'd take quite a few iterations in some cases. Times quite a few path finding ticks every frame, times quite a few blue lizards, times quite a few green lizards... I'm not really certain how to solve it just yet, but now that I know what it is at least I know what to solve! Awesome!





   JLJac on October 10, 2014, 04:29:22 AM:

Today's update isn't very exciting, so instead you get a ramble on game design! Yay!

I think all of these points on dragging are totally valid. In the end I think it wouldn't do thaaaat much of a difference, because it's a very slow and deliberate action in a very chaotic game. Any cunning plan like that is pretty much doomed. It's like that guy who'd try to punch a crate across half the map to block a door in a halo match - cool idea bro, but a million rockets and grenades and burning vehicles are going to wreck your day, and the rest of the game plays in 100 times the pace of your plan and will already have played out when you get there. Rain World is about planning and analyzing, but it's mostly on a 0.5-5 second scale rather than up in the twenties, or minutes. There are some minute-scale decisions in single player, such as "which area will I go to", but once those are taken the sub-goals will be much smaller chunks of decision making.

Also the game is fairly unpredictable. I know I've mentioned this as an issue before (I want the player to be able to feel at least somewhat in control of a situation) and I will work on it, but on a bigger scale it's such an integral part of the game design that it will just have to be dealt with. Which is something I don't necessarily view as a bad thing, because I think fun stems from a good combination of random and controllable. Think about tetris, it's random what blocks you get, but how they behave is completely deterministic. Rain World has a similar dichotomy I think, what creatures are where is hard to know, but how they behave and interact can be learnt and manipulated (or, it will be like that, once I clean out some of the weirdness and randomness).

I'm kind of aligned with fizmats idea of animal-level and human-level intelligence here, and that kind of reflects what I mentioned above - the slugcat is intelligent in split second decisions, but doesn't necessarily prepare elaborate traps. Definitely not crafting. That said though, the slugcat is the player's avatar, and whatever the player is able to think of the player is able to think of, you can't get in the way of that.

The third factor is something I think of as "world self containedness". Hmmmm examples. A self contained game world would be Pac Man. In pac man the little pac man creatures are what they are, and they are what they do. Ghosts chase, pac man eats. You don't really question why they don't do anything else, because they are what they do and all they are is what they do. You don't ask yourself why pac man doesn't try to talk to the ghosts for example, that's just not in the scope of that world. A non-self contained game world would be GTA. GTA attempts to mimic the real world, and thus its canon suggests more possibilities than its mechanics can provide. In GTA you can find yourself thinking "god why doesn't he just push the box with his hands" or "if I just had the option to say this thing to this character I could've solved this mess" or "why can't I open the trunk of the car! I want to open the trunk!" or an infinite amount of other things. GTA suggests a world where you could become a painter and spend your days painting abstract art (namely our world, where you can do that) but it doesn't provide the mechanics. Pac Man suggest a world where only eating is possible, and eating is also what you do.

I get the point of both ideas, when doing something movie-inspired like GTA the latter option is obviously preferable. But personally I prefer self-contained worlds. A computer game object is only its actions, and in a self contained game world it should ideally only represent those actions as well. Pac man eats, ghosts chase. I have a bit more technical resources than pac man, so I can make a slightly more complex world, but I want that same tightness of design. I want my creatures to be the things they do, and to be pretty much only that. The slugcat is quick, jumpy, climby, stealthy, nervous, always on the move, hunting and desperate to stay alive at the same time. The lizard is lazy and slow until it spots prey, then suddenly determined and persistent, making every single move in order to achieve the goal of reaching the other creature. The fly is a bit goofy, concentrated on its own business which is kind of obscure what it is, but suddenly panicking in order to preserve itself, especially when the behavior is amplified throughout a group.

Those concepts are realized through the actions - jumping, climbing, running, flying, chasing. The animation is then intended to amplify these hinted personalities further, but is always based on the actual game-relevant interactions. The slugcat for example has a nervous gaze switching from object to object, similar to the personality its behavior suggests - never really focused on a goal, but always determining the situation in this very now. "Was I one millimeter from death half a second ago? That's irrelevant now, because now I have a 0.3 second window to catch this prey, so I better give it a shot!" The lizard on the contrary is goal focused - staring down its target with tunnel vision, only giving other creatures a quick glance as they appear in order to make a swift calculation whether it might be worth it to switch target.

The idea is that interactions added should be in line with these personalities - further defining the creature using the things it does as building blocks. The slugcat shouldn't play basket ball, craft a gun or run for president. It would be out of character. And worse, it would break the self-containedness. If you can craft a gun, why can't you make a car? Suddenly it becomes obvious that the limitation is not the edge of this world, but of what I could be bothered to code when making this game. Willing suspension of disbelief punctured!

Dragging a corpse as a bait? Maybe! It could definitely be a part of the slugcat skill set. It's not vastly out of character, just maybe a little, as it suggests thinking several minutes ahead, which we haven't seen much of so far. But if it does add to the game, or if it could be done as a more on-the-spot action rather than a lengthy and deliberate one, it could even be a welcome nudge in a new direction for the character. Giving it more depth! But, as you can tell if you made it this far, there are several things to take into consideration when adding something like this.

That's what's going on in my head when I think about what new features might be like!

Update 335
Sent an email to UnityVS guys and got an answer that they simply don't support break on exception, so it wasn't that weird after all  Tired

In other news, creatures carrying other creatures (and inanimate objects) through abstract space, into abstract space, and out of abstract space, is now done! It's actually a pretty huge step, but it's not really the gifable kind - it looks like leaving a room and then when you go back into it everything is where it was and nothing has happened. 
Hand Shake Left  Cheesy Hand Shake Right

The system supports carrying of creatures carrying creatures carrying creatures etc. So you might see a lizard carrying a lizard carrying a slugcat carrying two flies hahaha!

There was some trickyness to this, because when a creature carrying another creature exits a room, it pulls that creature with it. This means that I wasn't able to resort to the classical iterate-over-the-list-backwards solution when updating creatures in rooms, because they were not certain to only remove themselves, but could pull any random chunk of other creatures with them from both before and after themselves in the list. You code people, if you could give my solution a quick glance and tell me if it looks OK?

Code:
    private List<AbstractWorldEntity> entities;
    private bool evenUpdate;
    private int roomIndex;

    public void Update(int timePassed)
    {
        evenUpdate = !evenUpdate;

        bool allEntetiesUpdated = false;

        while (!allEntetiesUpdated) {
            allEntetiesUpdated = true;

            foreach (AbstractWorldEntity ent in entities) if (ent.evenUpdate != evenUpdate) {
                    ent.evenUpdate = evenUpdate;
                    ent.Update(timePassed);
                    if (ent.pos.room != roomIndex) { allEntetiesUpdated = false; break; }
                }
        }
    }

This is in the room class. What I want to do is update each entity in entities once, but what I need to account for is that the update call might remove the entity and any number of other entities from the list.

In English, my solution is this: I iterate over the entities list and update each entity, setting a bool in them so I know I've updated them this frame. After each, I check if it's still in this room, or if it has moved out. If it has moved out, I break the loop, and start it all over again, once again iterating over all the entities. But because those already updated has the bool set, they don't get a second update command. I repeat this until I have been able to iterate over the entire list without any breaks.

Should about do it, right? Let me know if there's any problem I didn't think of.





   JLJac on October 12, 2014, 04:06:49 PM:

The slightly weird mechanic is because I've been prepping for a potentially very large world. Each room will keep track of what time it was when it had its last update command, and when it get a new one it'll calculate a delta which is passed down to the abstract creatures. The creatures will use that to increment their counters and to calculate some chance-based stuff, such as the probability of two creatures in the same room encountering each other. For example, if a creature wants to move out an exit it needs to wait a corresponding amount to the distance to that exit before it can do the move. This way the idea is that the abstract world will be able to function even at a very low or irregular update rate, which might be cool if the world is large and we want to update areas close to the player with a finer granularity. This is also why the room owns the "evenness" parameter - all rooms are not updated at the same time with the same evenness, that's the idea of this whole architecture.

Yeah, carried creatures might or might not get an update - but as you say, they don't have much agency so that's perhaps not a big problem. What's worse is the other one you mention, that a creature could potentially surf a wave of updates by moving between rooms. From a strict gameplay perspective I don't think it would matter all that much (all of the abstract space feels pretty fuzzy to the player) but from a purity standpoint it feels pretty bad, yeah.

Maybe I could move the "keep track of how long ago I got my last update" down to the creature level instead... That way they could get two updates quickly after each other, but the second one wouldn't really have any "juice" to it as the calculated delta would be very small.

What is it, saving the milliseconds since 1970 is just a long int right, and that'd be just the same size as 2 regular ints? So saving time as 40ths of a second would be pretty mild on the memory and without any risk of the ints actually hitting the ceiling?





   JLJac on October 13, 2014, 12:21:43 AM:

Update 336
Den awareness! The lizards (and other future creatures) can now keep track of a home den. If they don't have one, there's a routine that looks for the closest one throughout the world map. Whenever the lizard re-maps movement territory ("it seems I'm in a tile that I had mapped as inaccessible, I should do a new flood fill to check what tiles are actually accessible to me") it also restarts this routine. If the routine runs out of options, it'll tell the lizard that it's stranded - in an area from where it can not reach any den. I think it could be pretty cool to have creatures panic if they're in this situation when the rain comes. Otherwise, it finds a new den and remembers that one as its home base instead.

Here's a lizard catching a slugcat and heading back home with it. Excuse the slugcat being on top of the lizard's snout in the later rooms, I haven't gotten around to moving it in there for situations where the grasp exists on spawning the creatures.



As always in Rain World it's assumed that the AI entity is omniscient about the level geometry - having them be unsure of what's where would be a nightmare to program and it would pretty much only amount in obscuring the intelligent behaviors I've painstakingly put in.

Also, I now theoretically have support for fleeing from rain! It was really simple, I just added another Utility to the lizards decision making machinery. Currently I have it following this Urgency/Utility curve over time as the rain approaches:



But I think that in the future it would probably make sense for it to take distance from the den into account instead of only time. It should probably be a simple division, how far am I from home / how much time is there left. So, more refinements to come, but the basic behavior is in.

What's not in though, is creatures actually being able to be in dens. Now they just weirdly pop in and out of them over and over again. I think this won't be a huge task though (touch wood), I'll just keep them in "shortcut mode" while allowing them to interact with some sort of Inside Of Den class, which can allow them to drop off some food, wait for a bit, or whatever it is they want to do.

It seems it's not far away that we have the player hunting and fleeing, and AI creatures hunting, fleeing and taking cover from the rain! That'd be the most basic gameplay mechanics, all working and interacting with each other!





   jamesprimate on October 13, 2014, 06:45:08 AM:

if you think that's wonky you haven't seen nothin yet!  Wink

Don't worry, that one is just the "abstracted room" overlay showing activity in adjacent rooms. For game "debugging" purposes (seems weird to say that), there are a LOT of ad-hoc HUDs hooked up for showing various information, but there won't be HUDs of any sort in the game (if we can do our jobs right!), so no reason for them not to be ugly and wonky  Hand Thumbs Up Left