Aug. 19th, 2018

Work Post

Aug. 19th, 2018 04:54 am
relee: Picture of Relee Starbreeze, Wizard (Default)
4:55am - Well I was feeling pretty down this morning and I didn't want to do anything, and I slept all day yesterday, so I'm not tired, and so I decided to come out to the McDonalds and work on my projects. I don't do my best work when I'm down but it keeps me busy and tends to improve my mood, so here I am.

Now last time I worked on my Roguelike Project I was about to implement a grid for tracking the positions of the tiles relative to oneanother. After having some time away from the project though I had a few questions and concerns pop up, including wondering if it was right to put that sort of thing in the Controller instead of the Model.

I'm going to look over the code a bit and make sure of where I want to put this.

5:07am - A-ha! I thought so. I hadn't looked at the Model last time, since I was so focused on the Controller, but the Tile class has position properties and the World class already stores the tiles in a two dimensional array, so I don't have to make a reference array.

5:34am - So I've suddenly hit a design snag. It's coming from the code I used to start myself off, and as I recall it was a split second decision by the fellow who wrote this bit originally. See, he made it so that each Tile can have an InstalledObject and that InstalledObjects have their own movement cost, and that if the movement cost is 0 then it's impassible. But, what about tiles with no InstalledObject? Or tiles with passable InstalledObjects? How do I determine the movement value to pass through them?

Well this is something I have to figure out on my own, since it wasn't implemented in the base code or even part of the design of that.

So, I could have the code figure out if there's an InstalledObject and use it's movement value or the tile's movement value if it's not present. But what if there's a passable InstalledObject in an impassible tile? Like a table in a lake? That would make a bridge I guess. Walls are installedObjects so there can't be anything placed on top of a wall.

When I think about it, I'm not sure there will be any impassible tiles, just impassible InstalledObjects, since that's where the walls come in, and for better or worse any floor tile can be entered, even if it's water or lava. Or can it? I was thinking of making this like a Mystery Dungeon game, and those don't let you walk on water by default. Well, I think I can make shallow and deep water tiles and have them passable but only under certain circumstances later on.

For now I'm going to make it so that it checks first if there is an InstalledObject, and if there is, it uses that's movement parameter. If there isn't, then it uses the tile's movement parameter.

6:51am - Okay I think I've got the code working for moving characters in the upwards direction. I'd like to test it before either copying it eight more times or making a function, but I can't properly test it since I still have to write the code to move the character in the view from square to square when the tiles update.

Also I got really distracted and spaced out for like a half hour...

7:19am - On closer observation, the code WAS in place to move the player's sprite, but it wasn't working right.

7:30am - Alright, now it's not working right in a different way. The function is running but the sprite isn't moving.

7:53am - Okay I figured out what was wrong, I forgot to add to the position for the movement, so it was effectively moving to where it started. Ah well at least I found it without too much hassle.

Now I have to make the other directions work.

7:58am - Alright I encapsulated the code in a helper method, and it works fine. So, I'll set it up for the other eight directions now.

8:03am - Alright I've got the inputs working but not correctly, for each direction. I think it's a problem with the InputManager though, not taking in the diagonal inputs properly. That's in a different domain of the program, though, and I'm tired and have to use the bathroom and I think I've done enough for today, so I'mma pack up and go and leave this problem for next time.

Work Post

Aug. 19th, 2018 09:29 am
relee: Picture of Relee Starbreeze, Wizard (Default)
9:30am - I'm at home now, just watched the latest Ducktales (2017) and they really went there with that? Wow.

I'm already feeling like doing some more work, though, so I think I'll take a look at that movement problem. I'm afraid it might have something to do with the input timer I put in, though, and I'm not sure how to handle the input without one...

10:03am - I managed to get the inputs working properly. I had copy-pasted some code and didn't change the active string in it, so the movement was acting a bit weird.

So, I've got my little man moving around the dungeon now. Let's make sure he bumps into walls in all directions next...

10:07am - Yes, the little man bumps into all the walls properly.

What next? Well I guess I'll update the HackNPlan...

10:23am - Okay, HackNPlan updated.

Now to decide what to do next!

Currently my little man goes out of order, not following the turn order. Normally he should only respond to inputs on his turn.

Once he does, I can also add baddies to the turn order, and other things.

I can also make the dungeon more interesting at this stage, or hold it off until later. I'll probably hold it off until later, though, since there's no rush for interesting dungeons. Not until I need to test the pathfinding AI for the critters, and implement line-of-sight and lighting, the last two I might not even do in this version. We'll see.

So yeah I think I'll put my little man into the timing system next and see what that does to my code. I'll probably have to add another check on top of 'Is the tile blocking?' and 'Is the InstalledObject blocking?' to 'Is the Actor blocking?'? Heh.

Well for now I'm going to take another break. Think about things perhaps.

Profile

relee: Picture of Relee Starbreeze, Wizard (Default)
Relee Squirrel

July 2023

S M T W T F S
      1
23456 78
9101112131415
16171819202122
23242526272829
3031     

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 19th, 2025 02:51 am
Powered by Dreamwidth Studios