This video demonstrates how to simplify map update logic in a game engine by combining lists of connections to check for removals and additions, using helper functions for connection management, and implementing proper validation for connection data including parent IDs and coordinate offsets. The developer shows how to handle both cardinal and tagged connections, update adjacent tiles, and manage connection tables efficiently while avoiding common pitfalls like duplicate keys and null reference errors.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Mongoose Engine | Cleaning up More of the Map Update Logic to be SimplerAdded:
Well, hello there.
Let's make sure everything's happy here real quick.
seems okay.
And we'll make sure this is good. And it is.
And you are you good? Are you happy?
I can't tell.
I may have sound issues. Hang on.
Uhoh.
Oh, it also may just be That's all right.
There we go. Okay, I think we're all right.
I think it was a Mayan problem.
All right. So, we're going to go with that until somebody tells me otherwise, I think.
And we'll get started here.
Make sure I remember to mute you. Yes. Good.
Actually, I was going to check seeing my connection bounce a lot.
No thunderstorms forecast today.
So hopefully whatever is causing those little blips will clean itself up. But we will um press on.
I'll get some tunes going for me over here so that we can uh get started.
Um Oh, also hang on one second.
Make sure that that doesn't turn on an inopportune time and be noisy. Um, I'm blurry.
Oh, webcam.
Why do you defy me?
Okay, that's better now.
the the this we need to take a look at this.
Let's get this going.
Um we're working on updating the tiles whenever we change a room. So, we clear anything that needs to be deleted.
Um and let's actually go to entrance here.
because that has one of them. Um, the deleted part is easy. We add you to the tables if you're missing, right?
Same way we did the other ones or to the to the list that we need to delete. And then we go do that.
Um, we're going to have new data coming in.
And when we do this, it's not present. We need to add it.
And because let's do this.
Um, let's combine these two lists.
So we can expand you and then um we'll also do the tag connections.
combine the two lists of connections to check for um things we need to remove or up or or add.
And then I think we can actually get rid of this because we'll be going through um a different list now I think.
So then we can go through perhaps um Oh, this is still sorry. This is still our new room to update cardinal connections.
Um, we need to also combine the new stuff so that we can go through them.
Um, this is not current object. This is um room to update cardinal.
Uh this is tagged.
So then we can go through yeah here combined existing connections and then we can check for um combine new connections. If they don't then we can uh in theory can it clear it from tables?
Um just like that.
Uh we need one of them there.
This is just going to be connections, not just cardinals.
Okay.
And this is actually um remove any connections and then Is there a way we can get this done?
I don't think so. I think we just have to go through again.
Um, combine new connections. Um and then if combined existing connections does not contain our connection data.
The UYU ID for this is null.
Why did we do that check?
Um, can we use our connection delete helper here?
Um, because I know we have one.
Is there an add connection helper we can use here? I know we have a bunch of different helpers for these things and we may have wound up reproducing some logic here along the way. So, let's check those in a minute here. Um, add it to the connection tables.
Connection table.
connection IDs to the parent room IDs.
Um, go away. Um, this would just end up getting lost because we didn't handle the else condition. I don't think we need to worry about that anymore. I think we're I think we're okay there.
Um this where does this bracket closes this? If the current object is not null then we do this behavior.
Um, this should probably be in an else, right?
As soon as play time, it makes sense to check it.
Um, but yeah.
Yeah.
Oh, I see. It's because we combined checking.
We also use it to check if there's a room data already in there because this is the room update.
Not depend.
We also check to be sure this is a room data here.
So needs to be run on both update and addition operations.
That's okay.
Um okay. So then we say that the location we verified it's cool. It's equal to my room to update.
So that should override everything. And then we update update the adjacent connection tiles at the offset location.
So we go around them and update them so that they currently display the correct thing.
Okay.
And because this only goes through compass vectors, um, or not, uh, uh, not there, uh, cardinal directions, that should be fine.
And I'm pretty sure we boundary checked everything. But again, we probably need to change the way that works a little bit so that we can have a connection, let's say, over here, right? Which will be the case here because this this connection lives over there. Um, okay.
So, we're there with regards to that currently.
Um um um go one sec.
That's not what I want.
Just double checking something real quick here.
Okay, we're good.
We're good. Um, all right. So, this should be okay still because we go around and we figure out what we need to do and then the we rebuild the connection data objects basically.
Um and that works for everything that is a cardinal.
Um, okay. So, let's take a look at yield the offset parent coordinates. I thought we had we have clear connection from tables. That's fine.
Um, set destination table value.
Where are you used in flight map and update connection data? That makes sense because we're changing the connection stuff.
This probably ends up needing destination coordinates to the connection ID. This probably ends up needing to be a location instead of a coordinate, but um we'll hold off on making that change until we get there.
We're still Yeah, we have a clear connection.
Clear connection from tables. Update adjacent connection tiles.
Clear connection from tables is this one.
Update adjacent connection tiles at the parent room location.
which we determine from the connection data we go to a connection table. Okay.
So theoretically, where do we use you?
Use you on delete selected tile.
And only when you're a connection tile.
Okay.
But this is going to kind of be expensive because we go through all of our neighbors when we do this.
And we also don't we don't even clear you from a parent.
That seems wrong.
We delete room which is actually going to do the same end up doing the same thing as we did.
Well, not really.
Um, okay.
This guy also will need um connections that target adjacent or other maps.
That's a to-do for us to figure out today hopefully.
Um okay. So update is that Update connection tile neighbor location.
So we have update adjacent.
And then the other one we have.
Wait, no. I thought I was just looking at its update connection tile. Okay, I see.
And then you go around.
Turns out making a map editor for a complex multiplayer online RPG game is really complex. Who to thunk it? I know, right? How's Go? I wouldn't know. I'm stuck in Flutterland.
How you doing, Ash?
Yeah. Um, you know, two-dimensional arrays, I've always been reasonably okay with two dimensional arrays, but they are complicated. And thinking in cardinal coordinates, also complicated.
Adding the ability for multiple maps to exist also complicated.
Fortunately, I only have to deal with two dimensions and not three.
Flutter Butter. A real Go programmer would have coded up a Go to Flutter transpiler by now. See, that's that's a trap. That's one of those traps, right, where your your your scope creep gets you.
I already get squirrel enough. That's how that's how um the mock token uh jot token utility came to be because I needed it for testing and the option sucked.
Scope creep is just the fancy Jenzie name for lazy.
That's not true at all.
100% wrong.
Um, I should test this really quick actually because this should still be running.
Uh, I want to make sure I don't have like a an error and it has to be on a room to engage this code path. Um, make sure I don't have anything weird going on with.
Yeah. Yeah, we're good.
Deleted. Apply. Oop. Nope. We're not good.
Apply has not applied. Okay. So, something has gone wrong.
Let's reset that. Double check my understanding here. We'll delete south again. Got to fix this expanded by default thing.
Yeah.
Um, is that a state not updated thing? I don't think so. It's a this wasn't actually removed thing. And then provided tile type is not handled. Okay.
So maybe I can't get away with the thing I was thinking about. So we got some some shrubs to iron out.
Let's do that really quick before we get further down this path.
Um uh tile type is not handled. Okay. And that would be coming from here. Then up here in my update if it's a connection data because this needs to be connection tile.
Oops, that's not it.
That's the tile type that I'm looking at.
Connection tile can't be assigned to the uh Oh, cuz this takes a connection data tile to update. Hang on. What am I sending you when I save?
Uh when I was young and full of spite, we coded anything which wasn't invented here, which was the style at the time.
Yeah, you'll get that.
The um oh, who was it? um Joel Spurski I think um made the argument that not invented here or rolling your own was a good idea if it was a core like element of your product that you wanted to actually make. Right? So the editor pretty core to what I want to do, right?
So even if there was an offtheshelf option here, it would make sense for me to roll this if I really wanted to if those options didn't look like what I wanted, right? Um but and and you okay, so uh even better example is this this two-dimensional uh scrolly boy here. this grid.
It's a widget that I'm not a huge fan of. I'm not super enthused with the way it works, but it's good enough for now, right? This would be a candidate for something I could um do my own version of in the future, maybe because this is really core to what I'm doing here, right? I could make this a little bit nicer, maybe. Um, but a go to Flutter transpiler is not core to what I want to do. So that would be a bad thing to try to invent without a dire need. Right? And I thought that was an interesting take and one I think I kind of agree with just as a general principle, a guiding principle, right?
I think I think it was I think he titled the post like literally in defense of not admitted here. Let's find it. Let's see if we can find it.
Yeah, there you go. Have a little reading.
throw it in Twitch, too, in case anybody's lurking, wants to read.
Okay. Um, you uh you're a connection tile. You have connections the because Okay. Okay.
in my state provider here on um save tile changes before I went through the list. Now I don't go through the list. Now I'm feeding it a tile which is fine.
Um, this would be not that I don't think this changes because this was always update tile selected tile.
Selected tile is an object.
Um when we select yield tile set selected tile room data. Yeah.
Okay.
But when it's a connection tile, it's a connection tile.
So what I should be doing here, so this is part of both problems as to why things aren't working is this used to rely on having or rather this used to rely on status um map state provider feeding it that list after we updated the room. So we need to roll that into our update room.
We need to also update the connection tiles when we do this. Now um previously map state had a list it ran through the update method and also because we pull you out. Why is this room data as opposed to room tile?
I've done things kind of in a different way.
Likely because these guys are all different um objects.
Um, but when we do this, we grab you from the UI grid.
Undefined classroom tile. What did I make you? What did I call you?
Um, tile data.
Yeah.
So you would be tile data, but that's not an object. Oh no, it's just not imported. Okay.
But the UI grid.
It's because of the widget.
This is a UI widget. That's why if you're a connection tile this is still a data model. Okay, I'm just getting confused by my naming, which means that my naming wasn't great because, you know, there's only two two problems or two hard things about software naming stuff, concurrency and um boundary errors.
We're off by one errors.
Um getting a little hot and stuffy in here even though it's supposed to be like it's cloudy and dark out there.
What's it getting to be?
I guess it's going to be 85 today. Even though it's cloudy, it's still warm.
I got to look into like getting a portable AC or something that's quieter than my main one. That's going to make this a lot easier, I think.
Uh I haven't read this particular Joel post. Well, I have now. It's a good rule of thumb. Yeah. And and like I was saying yesterday, like you know, it always it's always a balance, right? And you just try to do your best with your body of experience and past pitfalls to um endeavor to strike the right balance.
And when it's wrong, it's wrong. And you just spend some time cleaning it up.
It's fine. It's software. It's not the end of the world. Managers need to [ __ ] off.
Uh, rapid reuse is how you end up with npm. Yes. Remember that fun left pad thing? Yes.
Deeply, deeply funny in a we must laugh so that we do not cry way.
Okay. So, this is still Yeah, this is still the correct data model. um connection tile selected clone. Okay, fine. Perfect. That'll clone these guys.
But then when we save um update tile selected tile. So we get a tile data here, not a connection data.
um U right here. U connection tile.
And then we need to say for um connection data CD sure in tile to update connections because they all have that ability. We gave it to them. Then we're updating connection tile or connection data. That connection data. There we go.
Let's make sure we get a nice fresh copy here real quick. So, this should fix editing you.
Okay. It's not appearing here though.
Did we?
That shouldn't be a state thing.
Something else is right here.
Sumat has been jumbled.
Unsafe tile changes is false.
If map wasn't marked as changed, we do mark it as changed and then we notify listeners. We res set the selected tile. Yes, that's also true. Did I set selected tile? Nope, that still gets set. UI grid location.
And you're no longer deleted isn't applying. Okay. So, we got something going on there.
Is it selected? Um, we haven't messed with clear connection, I don't think.
Clear connection from tables used to remove it from the parent as well. Now it doesn't. That's why.
I bet.
What if we when we came in here um and do the update tile, we go through the connections on you update connection data. Uh, we get the parent. You're not null.
turn off their location tile. We get you. Oh, it's going to end up uh cardinal connections length parent connection connection vector is equal to this connection to update.
shouldn't be in the inter map stuff.
Where would we do delete here?
Um I remember reading about that left pad and so on. Apparently right after that a bunch of people cleaned up their dependencies a little but I think we sent crept not only back but surpassed it way more. Yes.
Yeah. That's like so I should learn more front end, right?
Because front end is the shiny thing that you can say look I I can do these things for your website, right? Um but I I hate the JS ecosystem so much.
Um, last time I played around with it, I tried to import a like a design system, I think is what they call it. Like like material, right?
Uh, it wasn't material, but it was something else. And it was literally hundreds of packages. And I was just like, guys, what are we doing? You know, I remember that because of all the sudden publicity, the mpm package called is positive integer managed to get their dependencies down from three to zero.
My soul uh reminds me a bit of that Fry and L bit of Fry and Lori bit about estate agents except for JavaScript code. I am not aware of those people.
As a bit of a joke, do you want to know which three dependencies is positive integer used to have? Um I I don't even know. I I don't even have a funny guess. I don't even know what What was it?
Um, this wouldn't trigger on a deleted though.
What did we used to do?
used to do the sorting thing. Yes, that's true. H this is selective. This isn't um save tile changes.
We used to call clear connection here if it didn't um if it was stage for deletion. So we can reproduce that.
That's okay. Uh here's them pass all is positive and is integer. The entire module used to be basically pass all is positive x is integer x cuz writing an and operator are still 2011 my soul it's a deep pain it's a deep burn.
Um there was uh what was it?
Um was it Zed that wrote about it?
his um his ecosystem is really hard to understand cuz he's got like blogs in different places.
Yes. Here we go. Okay.
Was it this one?
Um, I don't know if it was this one.
It might not even been Z. It might have been something else.
But um effectively they were say pointing out that like the whole um like that was like the beginning of all of this this outsourcing and in this AI generation was the fact that nobody can write anything um simple anymore and they have to import all these packages and just glue them together and you've basically created um an entire industry, the front-end industry is entirely just code plumbers and it's easy to automate because that's all they've been doing for so long. And I don't remember the source, but I was like that might be a little extreme, but you're you're kind of not wrong, you know?
And people used to make fun of FSBuzz Enterprise Edition in Java, right?
Well, we all know my thoughts on code tests.
Don't worry, we've had Node.js for ages.
So now we can use the same approach on back end too. What a world we live in.
So I was reading something at some point in time that was it was like a recruiter their blog from like talking about the market from their perspective. Um and they were saying essentially that uh what they're seeing is huge demand for Typescript and not you know proper backend languages uh in in the startup ecosystem which kind of makes sense right because they um that's where the slop lives a lot right like like even before the the LLM slop startup slop was a [ __ ] node is part of it.
Like you could have a lovely backend system in a sane language and make calls into that or you can hire the same dirt poor college intern to write everything in the one language he was taught in school.
plus side. A lot of LLM slop is noticeably better than what UX code often looks like. So if we restricted to that, we may even get a net positive, ignoring the environmental impact. See, I don't think that's true. I don't think that's true. Um, I've noticed that there's a definitive uh like a split and for a long time I was really confused about it because I've I've mostly just lived in the back end because every time I wind up doing front-end stuff, um, up until recently, uh, something catches fire and they need somebody who knows what a goddamn server is so that I can turn it off and on again and then fix DNS or whatever. and I get sucked right back into the things that I do know, which is like everything but front end, right? Um so, um the uh I've never really just had the time to sit down and really learn that. But when I started, I noticed a def distinctive difference in Stack Overflow between answers to backend questions and answers to front-end questions. Backend questions, you'll get like an explanation. This is why that doesn't work. Here's some links. Sometimes you'll get a gray beard that'll drop in there and go, you're fundamentally misunderstanding this, and here's the deep lore on why. On the front end, you get copy pasted. Um, take this solution.
It worked for me. Like, what? No. No.
That's not here. That's not what we're here for.
LM's really like NAH. So, at least they would pull in some independent. I mean, maybe. Maybe.
Don't get me wrong, I don't think we should use LM for any code. This is more an indictment of how bad UX code can often get. I mean, yes, it's it's a really bad ecosystem.
Um, and dipping my toes into it more taught me, um, you know, not really taught me, but gave me a lot more perspective on a lot of the people out there. Just put it that way.
Uh you even see it in in Flutter, you know, a lot of the same things hold true um with the the way people answer questions. They're like, "Use this package." No, answer the question. That's not what I asked.
That's the other answer you always get.
Use this package. Use that package. No, I'm trying to understand the problem.
You bastards.
And hopefully actually you know the current state of the job market for software specifically I hope it reduces the amount of people in the field who don't actually enjoy making good things.
I hope if there's a bright side, let it be that.
Um, okay. So, we need to do the same up here.
Um, not that but the um controller.
Um, what was the uh uh uh update? Yeah.
Yeah. Yeah, in here connection from tables um up here and update tile.
If um if you're staged for deletion, then we need to um Oh, what were you clear? Clear connection.
You otherwise I guess we could do that.
We could just do that.
Um, so we clear it or we update it depending on what you have asked me to do. Now you if I delete you, let's make sure that that's still not just old stuff. Back to the gym. You I delete you.
Something is still arai.
What has gone arry?
We're operating on a when we click delete.
We used to have a list of connections in the state here. We don't have that anymore. We have the selected tile.
Um, delete.
Where was my delete?
Delete connection. Delete forever outline on press. Delete connection.
Map state. Clear. Pending connection.
If it's a if new connection is set clear it otherwise here it's because this do I have a different object somewhere along the way? Um, you I need you to debug and I need that need to click on the right thing for the change. Oh my gosh.
Go away. Thank you.
Um, into the gym into here. Delete. You apply. Come in here.
This selected tile has two connections.
The south is is staged for deletion. Okay. So, we go in here.
Step in for me. Update tile.
Your connection tile. We go through page for deletion is false on you cuz you're the north.
Um, and then you are the south. Stage deletion is true.
So, we clear connection.
It's here. It's This used to remove it from Okay. This used to also remove from the room, but we don't do that anymore.
That's why that was in there, which felt weird.
Um, okay. We need to wrangle our stuff a little better here. We've got too much stuff flying around that kind of grew up as we split things apart in here.
And these are kind of symptoms of the same thing, I think.
Um or we need to put back the room removal here.
I don't think I want to put the room over there. I'm happy to have it clear it out of the tables that we maintain because that there's logic around clear clearing up um cleaning up anything with no references, stuff like that, right?
Perfectly fine to have that. Um but you clear connection parent room tile location updated JSON connection to so here um and are you it is the offset location room table parent ID So in theory, um, I should be able to do.
Tired of getting tired of addressing these coordinates directly.
I want this to work. I want this to be um I I don't want this to be an object. I want this to be a room data.
Um and then you're going to take this Uh, do I want to make this nullable?
A connection tile should not have a null. So, I think the answer is no.
Um and then room table offset coordinates in the map accounting for offset. Okay, so we can use that.
So room table parent ID Why is this nullable view ID value coordinate?
Oh, it's because Okay. Yes, that makes sense. Um because selecting from there if the parent ID isn't in there problems, right? So connection table, but my connection data doesn't know about his parent. It's the other way around. That's why we have the table. Okay, so that's fine. Um, and that's why we checked the UYU ID. Is there a way? Is there a world?
Can I just make you not know nullable?
This is deprecated name space enum. Enum's dartstead.
Um, where the hell is Enum's dart?
documentation.
Uh, this is documentation not for enum dart. This is documentations for the deprecated warning because that's obviously what I would want to look like at when I click that, right? Not like what the hell are you talking about? But like what does deprecated me mean?
Bastards.
Flutter UU ID.
Give me your repository.
Okay, let's take a look. See here.
Enums dart. Uh, can I find you nil?
No, it's UID value. That's why.
No.
How about enums?
Zil internal stuff. Nil value internal constants. No name space deprecated. Deprecated.
Deprecated.
That doesn't help me a ton.
I don't see enums.
Lib enum start. There we go.
Oh, okay. That's where we were.
Duh.
So, so you're in the same package.
What am I missing here?
Um, Would I have to do that?
Let's spell it correctly for fun.
name space. Name space wait. Yes, that Makes no sense to me.
The value ring, but that's just going to be okay.
Tell you what, you can [ __ ] deprecate it when you fix your API.
Otherwise, go to hell.
Okay, that's why it was nullable here is because we needed this.
But if we have to then nilch check the UU ID. If we do this um then we don't really gain anything from doing this, do we?
Because we have to have something in here when we unmarshall it or or we'd have to throw um an exception here. I guess we could do that.
Is there a way to throw Um, we could do this, right? And then and then do stuff here. Um, Let's do that because this is just butts.
Um that I guess you would be nullable here. And then this um this [ __ ] out of here uh if constructor ID is null throw argument error value constru inructor ID.
Um ID may not be null.
Why am I doing that though? If I could just do just say you're required like that's just the simple way, right?
Give it to me.
Um Oh, yeah. We did change the name, huh?
ID.
It's just required that you give it to me when you create me. I'm not valid without seems okay to me.
Um, so that means that this case can go away. We still need to check these other things to figure out if it's empty or not. That's fine.
I don't like how much of a pain in the ass it is to do that.
But now now the connections are not allowed.
Connection data add. You're just going to have to if you're adding Um, create this. Is that the right?
Yeah, pretty sure.
Create it. Do it. Do it now.
Um, we sent in no. Okay, we'll have to look at that in a second. Let's get this part hammered out. So this um can be that. Now if it's null then exception um has no parent ID in connection table. It's an error.
We need to figure out where it's coming from and squash it. Otherwise, coordinate uh not even coordinate. Yeah. Yeah.
Coordinate nullable here because again we're checking in room table parent ID. If parent offset location is null, throw an exception. Um parent uh ID not or connection has no parent connection parent is not in room table there. That'll do. So we just throw up errors. If there's troubles, we'll get it fixed. Um these represent invalid states. I'm pretty positive.
I could be making horrendous mistakes right now, but we're going with it. Uh, and then we're going to return, if all that is good, map, which can't be null, at parent offset location x, parent offset location y. Okay, let's spell this correctly. Let's do that as room data. If it's not a room data, it's an error. Freak out about it.
Okay, let's get that [ __ ] out of here.
We'll worry about that in a second. We need to just spruce it up here. This is no longer because we already pull you. We already null check you. And if we just do room data parent tile equals get connection tile parent.
Wait, did I name you something dumb?
Yes, I did. I was looking at the other one.
Parent tile. Okay.
What are you mad about?
Uh oh. Because I wasn't done editing you. That's why.
So, get that out of here.
Get all this [ __ ] out of here. There.
Better. Um this this parent tile cardinal connection. What are we looking through here?
Update connection data.
Parent connection. Parent tile. Cardinal connections.
What are we really trying to do here?
We're trying to update it on the parent.
So, here's what we're going to do.
This doesn't need to handle deleting at this point. Maybe we'll do that later.
um connection data in parent tile.
So we need to go through both of these.
Did I give connection data a is cardinal or something like that?
I gave you connection vector which we can use to determine.
So yeah, we'll just do it here. Um if connection update connection vector is not equal to direction invalid. Okay. If it's a cardinal connection, update that table.
Um isn't a direction.
Wait, what?
Connection vector coordinate invalid, not direction invalid.
Right.
Yes.
Otherwise, it's probably a tagged connection check there.
Okay.
And I suppose we could try throwing that in there to check and raise an error if we don't find it or something like that.
And do we have a No, that's fine though. I don't think I care.
Um, we'll worry about it later.
So in this case it's cardinal connection data CD in parent tile cardinal connections if C cd is equal well we got to do you um the ID connection update ID because we can't equal them one of them has changed if this is the case Then um parent tile. And here we're going to actually need final int index connection data cd in parent tile cardinal connections indexed.
That way we can say parent tile cardinal connections at index. And this might freak out and say I'm modifying a thing and whatever whatever whatever um connection to update.
Do I want to I want to clone it just to be sure.
Break. We're done.
Otherwise, we're going to do the same thing, but um the parent tile tag connections in next um the ID is equal to connection to update ID. The parent tile tag connections at index is equal to connection data clone connection update.
And again we break on that. It's a it's a success.
Now, um, we didn't find anything to update.
So, in this case, the ID is actually going to stay the same in the connection table. So, we're fine with that.
If we're adding, okay, that's still fine. We clone you. Put you in there.
Cool. Groovy. Love that.
Um, interm connection IDs aren't. No, they don't match. This is an intermap connection. Don't try to connect them.
But destination offset destination table value. Ah, okay. I see.
because we're not a destination in this table.
That's what they're really trying to do there.
And then same map connection tile data Why would this be Why did I allow this to be nullable? That seems silly to me.
What would that break?
Um, we do need to create you a new ID if we do that, which is fine. Easy enough to handle.
This is no longer allowed to be null.
It's just going to panic for me. Cool.
Love that. Get rid of that.
you. What is up with you? Get connection tile parent tile con data.
That's no longer.
Oh, right. Yeah. Um, that's a room data now. And then parent room tile. Don't need to check that anymore. We fixed that.
[ __ ] No, this is fine. This can't be null.
Um, if a connection tile exists for it, it shouldn't have been null ever at that point.
Um, I think uh, cheers for the background commentary while I was cooking up some burgers.
Dang, burgers sound good. Uh, sounds like the engine is coming along nicely.
It's going okay. We're working on the editor today, but things are shaping up.
Um, so what's going on with this? Why are you saying that this code is never executed?
Like I understand that this goes away, but why would that have made all of this not work? I'm confused. I don't know.
Just dart being dart. Okay.
Connection tile parent tile. So parent tiles just can't be null. If there's a connection data, it has to have a parent tile. Otherwise, we're in a bad state.
We need to panic so that we can fix it.
That's what I'm thinking.
That's no longer needed to be checked.
That's no longer needing to be checked.
So much better if you just don't make things nullable. If you can find a way, if you can be like life and uh find a way.
Okay, so we clear if you're stage for deletion. Otherwise, we update you.
That gets simpler.
Um, so we go through one of these lists depending otherwise. Okay, so this we have to be careful. If it's not updated, it's a new connection.
Um, you know what I want to do? I want to make this even nicer just to consume because we already have this connection vector.
We can use this to just nicely neatly um let's do a getter is cardinal. Let's just call it that. Is cardinal return connection connection vector not equals um coordinate invalid. Right. Cool.
So then this can become if you are cardinal we do that and then we can use the same thing here.
Um if uh uh uh uh connection to update is cardinal boom we put you into this table.
Otherwise, um, not you. Parent tile parent tile tag connections. Add connection data. We'll still clone you just to be sure we get a copy that isn't tied to anything else so nothing gets cleaned up. We had some kind of problem with that, I think.
Um there.
Meow.
Connection table connection update ID is that origin ID is not equal to null.
destination ID is not equal to null because connection data that's a location.
This one is nullable. It's allowed to be null in the data. So yeah, that's fine.
It's allowed to be omitted.
But we also have same map connection here that we added. So if it's not a same app connection then we just return like so that's what I think okay and then otherwise we'll do this needs to be a function. We've done it too many times.
Um coordinate um get offset coordinate. say uh we take a coordinate, we return C times our map offset, and then what do we got down here? That's Is it because you're unused? Probably come back to that.
Um you coordinate offset location room to update location. And this is going to be get offset coordinate U and then U get offset coordinate destination point U.
And that's you get offset coordinate parent location.
Just a nice little helper.
My beverage is broken.
Unfortunate.
Okay. Um with offset you I guess we can swap this. I feel like this should be nicer, too.
We could do something like um uh I feel like we need like a just to buckle down and get a cave in pressure and do like a getter.
Um, I'm thinking about that.
We'll see how often it gets used.
A lot is the answer. Yeah, this this is stupid.
Um, but we need you're an object. You're nullable because rooms are allowed to be null. Um just get tile. How about that? Um you take coordinate return map which can't be null c x c y.
Okay. I don't know why I've been putting that off for so long.
Um, hey, Mongoose. Have the blue-haired crab folk gotten to you yet? No, no, no, no, no, no. That'll probably be next week. I got to figure out how it fits into the schedule. Um because my blue-haired crab folk friends that have been around with the channel for a long time are mostly in the EU area. Um so if I'm going to do that content, I would prefer to do it when they are awake and can watch since they've been asking for it basically since I started.
Um not really asking but like hinting that they would like to see it, right?
Um, so I got to figure out how that fits in. I don't want to stop this project. I don't want to stop the other project I have. I do want to stream more more hours. Right now, the limiting factor in that is that it gets really hot in here because I can't run the AC while I stream. So, this week I'm going to try and expend some of my limited savings capital to get like a portable AC unit cuz if it's quiet enough that I can keep it at a reasonable temperature and humidity in here, um, then I can stream longer.
So, and that's just good for everybody, right?
That's kind of the game plan. Um, and if I can't get a hold of one that's going to work, I'll have to figure something else out, but I should be able to, I think.
Seems like a surmountable challenge to me. Um, but that's where we're at.
Okay, so we got our is Cardinal. Now, let's go ahead and just consume that. I know I'm changing more crap before I even know if this is uh correct now, but It's just it's it's time.
It's time.
Return get tile at the coordinate of with offset.
Okay. Sure. Perfect. Done.
Oh, this is tile at [ __ ] I just did that.
Okay, so if I had tile app, why was I using?
Why wasn't I using you?
You've existed and you've just not been used. Okay, I must have done it and then forgotten all about it. Um, let's call you. Let's do this before I change that. Let's do get tile at offset.
And then this can't return null if the map is null because I want that'll give us the wrong impression. That'll give us the impression that this tile is null.
This I think I think I'm going to do on both of these. Um I'm just going to throw exception.
This map controller has no map loaded.
We shouldn't see this, but we're going to go with it.
Um I don't know what you're running on, but you have an Nvidia card. Have you tried using Nvidia broadcast for audio filtering? do not have an Nvidia card. I use it during work calls and then window AC blasting for Yeah. No, I don't have an Nvidia card and like there is like OBS has filtering and stuff that I could set up to a degree, but when I'm speaking like my AC is really loud. It's an RV AC. So, because up until jobs weren't a thing, I was a nomad. I roamed all over the place. Now I'm kind of parked up because if I if my plans don't pan out and I got to get a job, I need to be near people to find jobs. So, um so that's where we're at there.
But if I can get enough income without getting a real job, that'd be ideal. And even more so if it allows me to get back on the road, cuz I really like going cool places and seeing cool things when I'm not at work.
Um, okay. So, get tile and get tile at offset. Cool. That should cover us for both use cases.
Um, let's go consume this in places.
Do we use room offset for anything else?
Room table tile. Uh um can I even get rid of room table here?
What if I just did that?
What if my target tile is um get tile at offset tile location and then this goes in the trash and then you parent location connection table connection ID room table parent ID. So that uses so I would use this would also be um get tile add offset parent tile parent location. So I've already got parent location. No I don't I don't it was there but I don't need that there. Um, this should just be get connection tile parent tile um, UID value connection ID target new This is in destination table. Okay, so hang on.
That's sick, man. Yeah, it was pretty sick, actually. I saw a lot of cool stuff. I was on the road for like a year and a half before I got laid off from the last job. Um, uh, I discovered that northern New Mexico is like foresty and mountainy and gorgeous. Um, I saw Meteor Crater. Um, I went and stood on a corner in Winslow, Arizona, as one does.
Uh, and I saw the Cadillac Ranch in um, northern Texas there. I forget which town that is, which city. It's town.
It's a large town, but it's town. Um, I saw that uh, and that was just like just getting started type stuff, right? Um, I have uh pictures of me standing next to um a scout tank at a at a a place in southern Arizona where they used to have a armor training area because it's a lot of wide open areas, right? So, they could drive their tanks around and they have some old hardware there. That was kind of cool to see. And like intellectually you think, man, tanks are kind of big if like four dudes could fit in there. But when you stand next to one, you're like, "Holy [ __ ] tanks are big."
And that's just a little guy.
It was uh even though it was a short time, it was a really good time because I could just um you know on the weekend I I would hit a local local site uh wherever and I would kind of uh um set my destination plans based on what cool things were in between me and where I ultimately wanted to be and kind of meander. So, I'd stay a week at a place, see something um on one of the weekend days.
Sometimes I'd stay like two weeks so I had a little bit more time to breathe.
Um but then I would uh see whatever there was or I would just work through the week and then hit the road again.
And when I got tired, I would stay for a month someplace.
It was really, really cool.
Um, okay. So, destination. Maybe we don't even need destination table if we're just smarter about what we're doing here.
Hang on. We're deleting a room.
Add the connections that have the target tile as a destination to the list.
Okay. Yeah. No, we still need this because we're looking at the um this maps our connections cuz they live on the origin um to what the destination location is. That's fine. Um connection table at connection ID is that um but connection table connection ids their parent rooms. Okay.
But parent rings ID destination table destination coordinates to the connection ID connection ID is their parent rooms ID and then um we can use room table here. So maybe we still need room table or I would be able to offset coordinates in the map. See, this is a really roundabout way to go about this. Uh, for how long have you been making this? Um, like like a year part-time.
Um, this is a really roundabout way to do this. What I really want to do, I want this still figure out what destinations connection destination coordinates to the connection ID.
Um, and it's because I don't really have the ability to control if I'm looking at pointers or not. That's why I did this.
Uh, do you commit to GitHub or just doing everything locally? Oh, GitHub for sure. GitHub for sure.
Anybody doing a project of significant size that is not using source control, stop it. Get some source control right now.
Otherwise, you're going to have a disaster and it's going to you're going to have troubles and then it'll be tears.
Um, so maybe I do need this even though it kind of sucks.
So I get my parent ID.
So true, right?
Um, and I guess that would just give me let's let's put this back to where it was.
But then I need parent location room table parent ID.
This stores them with the offset though.
So I can just do um get tile do I even care about the offset anymore um in connection table? That's a question.
open source or closed? Uh, closed for now. I don't know what I'm going to do with it in the future with regards to that yet.
Um, okay. And then remove tile.
So, this I would still I still need to do something. The stream is buffering a lot on my end. Yeah, my internet connection isn't the best today. It's been a little bit flaky.
Looks like it should have cleaned up um now for the past couple minutes.
Part of the joys of of being a nomad is that you get um let's take a look here.
Right now, stream is excellent health on YouTube. Um so, it should have cleaned up. Um like Star Starlink is your only option for internet when you're a nomad.
So, that's what I got. And this location being closer to a large city, um my connection has been less good. And I've tried to contact Starlink about it. Um, and it was an exercise in utter stupidity and uselessness. So, I closed the ticket and told them to shut the hell up.
Um, okay. So, we remove you, but then we still need to null this. Um, but there's no reason that we couldn't do like a set tile perhaps.
Do I want to do that? This feels fraught.
Uh, it's fine. I guess my net is also not the best. Maybe it's a problem mine.
It could be. Yeah, this language is Dart.
because I I don't want to do a setter.
That's that's what I don't want to do.
Um but we can do um get offset coordinate uh target tile ation.
So, we can still use that there.
So, we clear you from the tables.
Delete room. Tile. Tile is what it is.
Um, what did target tile come in?
tilt offset. Okay. Yeah, that's fine.
That offset.
Yeah, we'll go with this.
And then we'll explicitly null you there. That's okay. Okay. Um, where else do we have this being used that we can uh that's a little different. You offset location. Yeah, this is what is this? This is inflate. This should be get offset coordinate um tile data location instead of this. We don't need that.
Have you seen any other GitHub repos and how they go about doing these things?
No, it's just I mean there's nothing exotic here really. It's manipulation of data in a two-dimensional array, right?
Pretty standard just regular programming type stuff.
Um, okay. And then we're that gets put in offset location. Offset location target tile. This can be if you're not know inflate.
Okay, we're checking, right? That makes sense. Um, we still need offset location here to set it.
But this if you're a room data and that's because we're in rooms.
Um, the manipulation of data in a 2D array describes 99% of programming.
I don't know about that. Data in an array for sure. 2D is not as common, but it's it's not super uncommon either. I just don't know. It's 99%.
Um, could we get clever with this?
Yes. Yes, we can. Um, uh, this is get tile at not offset cuz we just did that.
Get it at the offset location.
Um and then this is if current tile is not equal to null and then if current tile is a room data we do that otherwise other things are crazy and we'll continue to throw that exception.
Um, it's not a room data tile.
Uh, maybe the 2D isn't accurate, but even that feels pretty common. I mean, it depends on what you're doing, right?
Like, do you work with lot with like tables? Tables are absolutely going to be like that, right? um because you got rows and columns, but usually you're dealing with one at a time like database rows.
Although if there are multiple rows, then yeah, it's two dimensionals. So maybe maybe right, maybe it is higher than I was thinking initially. Um let's see. I don't know what you're saying even after a full course on Python by Harvard. Guess AI has really done me some damage. Could be Python might be some of it. Also true. You've never heard of a two-dimensional array?
That's surprising. It's it's an array of arrays, right?
So, um, we can we can we can do a little we can do a little excalad draw.
That's always fun.
Let's clear this.
Uh, where's the clear this button? Um, reset the canvas. There you are.
So, you know about arrays, right? You've got a list.
Um, let's not do that. No, no, no, no.
Stop. Stop. Stop. Go away. Please. Oh, god. You.
So you've got just your standard list here, right?
Of a thing. Doesn't matter what.
What if instead of being an integer, this is another array, right?
That's all it is.
And like I was just saying, um I was thinking about um cases where you have multiple database rows, right? You just you can flip this entire thing either way that makes sense for you uh for the situation, which is kind of one of the things that's kind of about them, right?
You can see it's array and pi list.
Yeah. Array slice list. um all kind of get used interchangeably because different languages call them a different thing, but they're mostly the same in a lot of cases.
It's there's differences in different languages. Like in Go, a list and a slice are different things. A list is um immutable, a slice is mutable, for example.
Nowadays, everything ends up in a guey and guies are grids. So eventually, I feel like you always end up there. Yeah, that's kind of true because you got to think in rows and columns.
But in my brain they're kind of different too. Um but okay so like in an XY coordinate system this layout makes sense right but if you are like the same image is the same same layout too which is the weird thing right this could equally be so okay let's let's try this um in an XY coordinate system it makes sense to think about it this way you add rows to the column cuz you're at um or does does that make sense? Hang on.
This is where they get confusing, right?
Cuz your X number increments here and each X has a Y associated with it. Yeah.
Okay. But if this was if we're talking about like database rows, then it might make more sense to look at your your data in this shape because each of these rows in this list is its own entity, right?
And that's where they start to get like hard to think about, but like they're all the same at the same time.
So, this is what they use in chess engines. Uh, I would assume there's probably a grid, just a two dimensional array for the board, I would think, but I don't know for sure.
Like at at that's like the lowest level to think about them, right?
Is a matrix. Yeah, it's it's an it's got an x and a ycoordinate. And really, what you're doing is just um I closed it. Uh, we can go back. It's okay.
So, like either way, it doesn't really matter.
This thing has a name, right?
And so, this is foo at whichever order you want to do these in. um it's at x and so this is three or uh two rather uh and zero right that's the coordinate where this happens to live in this example um and then this would be fu at 0 2 right is 012 012 and then if you had Um if this was filled in like so this is fu at two two like so.
Yeah understood. Yeah.
And then at like once you lay this out, as long as you follow the same rules uh in your brain, like I know it's an XY, so X and then Y, right? Because I've laid it out that way because that's what a graph makes sense. You know, coordinates make sense. Its origin is here instead of down at the bottom, but either way, doesn't matter. Um, then I just know that I'm looking for foo at x y translates directly to x y coordinates.
Um, it would get a little bit more confusing if I didn't let 0 0 be the top origin point. You'd have to do something else there.
But, uh, I'll worry about that later when I if I add it. I probably should add it. But, um, future me problems.
Um, you because we're going through the list, we can keep you there.
This is a low level because this builds the initial grid. So, we're leaving that alone. We don't need the helper. This current object, we're using offset location here. Do we use it anywhere else?
We already have current object here though.
We use that.
Um, finally my school studies came in clutch. Adding zero for consistency for uh no no. Um, hang on hang on.
back to Exceladraw with us.
So right now in my map as it exists in the um UI here, right? Just copy you.
This is 0 0 right but in a where where you at? Give me give me a zoom. Oh, that's not a zoom. Is that zoom? There we go.
In a coordinate system, it's more common to be able to think about I guess it didn't rotate the way I thought it was. That's fine.
It's more common to think about this as 0 0 and then this is positive, right? So you can't see that. I know. No, you can't. Let's zoom in. Um, this being Z 0 right here.
So, a line going this way goes to 1 one or whatever, right?
Whatever positive x y, right?
A line going this way would be going to umx positive y, right?
And then the same thing being true here.
Well, true but different. This is um positive x negative y, right?
And then the same flippy over happens here to where um this is negativex negative y, right? Because our y-axis is up and down. The x is left and right.
Best way to remember the x coordinate I learned in high school from a cool teacher in phys physics class who got it from a kid. He said, 'Well, yeah, it's like when you're trying to make a make a stick fort and like you're trying to set it up and it collapses and it's all a straight line now. It's on the ground.
It's the X- axis, right?
It's the dumbest but best way to remember I found.
Um, but uh uh right now, right, this this is this is the ideal, the normal right now. Mine looks more like um you. And then we'll get you and we'll rotate you and it's going to go off the screen.
Whoa, that's not what I want.
So right now um 0 0 lives here and this is positive x positive y which is not a standard way to look at it right this is the easier way to look at it um to lay it out as a starting point but then I don't really get um I don't really get the benefits of being able to expand. Like if I wanted to take my map right now and double its size, let's say you started out as 10 x 10 and you're like, I need to be more like 20 x 20.
Well, then it's going to add that additional map on. So you're like here and then you would be you'd become this, right?
Um, and that might not be what you want.
Maybe you need more room over here and that's why you're trying to expand it, right?
Um, whereas over here, if zero is your origin of your map and you're like this and you're like, "Okay, well, I need to double it." Then it goes like that. Your origin stays the same. You get room around the sides, all that.
Uh, see, write your code. I'm distracting you. Please continue your work. Otherwise, you won't get it done.
Well, if I wanted to just like work quietly, I wouldn't be on stream doing it, would I? Chat is always perfectly fine.
Uh, let's go ahead and clear out that.
We're done with that for now.
I'm currently in college and my exams are coming. So, I remember these things, but thanks. Yeah. Well, you know, there's not only you here, so other people are lurking and listening and maybe it's helpful to them. So I say it to everybody.
Um, okay. So our current object be you.
I don't know why I made you like this.
this. We don't even need the offset location if Well, we do um because we'll use it later. Get tile offset location.
Um if the current object is null or is not null rather, we go through we update it all like so.
Otherwise, this could be our current object or Yeah, current object like so.
Oh, hang on.
Neither empty nor a room tile, but this is offset location. Oh, this is a room data. Yeah, yeah, yeah. We're good. So, we check that to be sure you're putting stuff in the right place. Um, that a positive way to look at it. Got it going out by cool. Have a good one. Good luck with your uh exams.
Um, and then you Okay, we still do this because we're setting it.
We still add you to the room table.
That's all perfectly fine. Um, we're using our new get offset there. That's good. Let's use the tools we created for ourselves here.
Um this connection tile um get tile location as oops as connection tile that can go away.
This guy being adjacent coordinate, we can still do at adjacent coordinates inverse tile.
It's fine. We still do um the inverse location calculation is fine.
Um opposite room get tile opposite cord target tile here. This is same set same app connection tile data get tile connection location as connection tile update connection data there. Perfect.
Okay. And that should be our last. This should circle around except for it doesn't.
This needs to be.
Um, get tile parent offset location.
All right.
There we go. All right. I need to take a quick break, get a beverage, and use the restroom and probably open a window. So, now's a great time to stand up, stretch out, do all that yourself as well. I'll be back in just a minute.
There we go. All right. Hopefully I'll get a little airflow going here.
Beverage acquired.
And um let's just double check here.
I can actually just um I could use um I could use this directly like so you are the null Paul, you are my um build map or load map.
You're a sadder.
You are uh going through the whole map to make sure everything got squared away. That's fine. Here my initialization. You can all stay the way you are.
This one offset location update.
Why did I do such a thing? Room to update.
because I'm setting you and then I'm doing that. Okay. Yeah, that's that's fine.
You're going to stay right where you are. Yeah, we're I think we're happy with that for sure.
Yeah. All right, cool.
That's squared away. Now we need to make sure um we need to get back to where we were before we cleaned everything up. We were trying to get uh clear tile working correctly. Clear connection rather. Okay. So we get you update adjacent connection tiles. Clear connection from tables.
This needs to be um we have a connection data.
So here we've got a tile.
We say if um con data is cardinal then parent room tile cardinal connections remove COD data and then otherwise we remove it from uh the um tagged connections and then we go update our tiles.
Let's give that a quick check over here.
Um in here into there.
Uh this one delete south. Okay.
Something is not right.
Room data is not a subtype of tile.
Connection tile in type cast that is happening here.
Why would you be?
Why would you be there?
Update connection tile.
Update adjacent connection tiles.
Ah because when we clear we call parent room tile location though room location This neighbor location is room location plus vector.
This needs to be Yeah, that needs to be you.
Room location.
It's It's an offset issue.
Um, so we just need to do get offset coordinate here. Just thinking about like what makes more sense for the API and I think it's this.
Let's reset you and try that again.
Yes. Now we can delete south. Uh it didn't disappear from here though.
So we need to take a look at that.
Means it's probably still in the room as well.
It's not.
So, we take you out of the connection.
Um, we update the adjacent to my room location.
Update connection tile. Neighbor location. Update connection tile.
is going to update all of them because we go around you.
Well, that would have been what updated it here.
This has got to be an issue in the connection for vector lead connection vector. Lead connection vector.
It's not null though. It's a room data.
Um, we go through your connections.
Go through your cardinal connections.
That's fine.
Set default tag if missing. This connection tile update connection. Con data.
Con data.
Adjacent tile get tile adjacent coordinate adjacent tile room data connection data in my adjacent tile cardinal connections update connection data adjacent tile cardinal connections my adjacent tile Disconnection tile update connection with con data.
adjacent to all cardinal connections.
This isn't removing you because it's going to find and update things, but the thing isn't there because we removed it.
Clear connection from tables.
update adjacent connection tiles. I don't know.
That seems wasteful.
I mean, we could be doing So, for one, this won't work in a world where um Well, hang on.
If we're shouldn't need to do this.
We should be able to be more surgical about this. So, we clear you from the tables and then if you're attacked, this is the only time this works. um handle cross mapap stuff here too. Um, if you're cardinal then connection model do you have?
>> Um, it's not you. It's um it's these guys.
These guys should have.
Why am I using dart? Because flutter requires using dart.
Um these guys should have a function on them, not the UI. the model delete connection for vector.
Yes. Okay. So, um if it's cardinal then I also want to get um the tile.
Now the that doesn't work. I have to do that a different Oh. Um I have a helper for this though. Um connection to offset parent location and target vector.
Why did I do this?
get asset coordinate pair and location.
Why don't I just take a um Why don't I do this connection data and then in here coordinate connection location.
I have the ability I can figure out where my parent is.
Um, parent tile connection tile takes connection data. So I can do that. Um, this is a room data though.
I can just do that.
So I know where its location is. This needs to be fed to get offset coordinate so that I can pull out my parent location uh with offset. Let's say um and then my location would be get tile.
parent location with offset plus um connection vector right as connection tile like so. But this could be invalid.
Um, if you're not cardinal before I do anything at all, throw an exception.
Can't get connection tile of um connection objects are not cardinal otherwise we can get that and then let's deprecate this and by deprecate I'm just going to delete in this case uh you do.load location um your connection tile and I'm looking for the data location here.
Oh, except for this is going to return me a connection tile.
I can't get a location from you. You don't know about locations.
So I probably also require this. I can still take a connection data.
Um it's still an exception if you're not cardinal in this case.
Uh I get location of connection objects are not cardinal.
you um you're my offset coordinate connection parent tile location.
um plus my connection vector.
Okay, that should work. And I don't need this anymore.
You can just be that. Um teleocation.
This is not allowed to be null anymore.
That's fine.
What else? You're not used right now.
You might not be used.
Let's just get rid of you for now.
You Nope.
That's where you're going to be used.
Get connection tile.
for pond data.
I get you. I get my parent.
Although, we don't even use you then.
Don't use you. What the hell was the point of that?
Just old stuff. Okay, cool.
Oh, duh.
We were adding you.
So, we clear you from the tables.
This needs to go into here. So, if you're cardinal, we do that. I also need to double check.
Um, this needs to also be uh connection distance less than 1.5 because if you're not vector from direction gets me invalid cuz vector 2 doesn't account for that. Yeah, cuz if you're far away, you're not actually Cardinal.
Thinking of starting a stream on YouTube and calling it watching Mongoose building a mug game engine.
It'd be uh streamception.
How you doing today, Marco?
How's all the everything?
Um okay. So then we get this tile if you're cardinal.
Um and uh the this tile is a connection tile. Uh delete connection for vector con data connection vector.
That that should take care of this.
Let's reset you and let's actually just do a hot build here to make sure we got new shiny code everywhere.
Now, if we go in here and we delete south.
No, something has gone totally ary.
Connection has no parent ID in the connection table. Well, that ain't great now, is it?
Why would you have no parent ID in ye old connection table has no parent ID?
Connection tile. Parent tile. Connection table. P ID get connection parent child my get there.
Um this should really just be connection parent tile for one.
Don't you How are you doing me? I've not forgiven your squirt crimes.
You don't like my math squirts?
Uh, this is still I'm so glad you enjoy that so much.
you why why don't you have you should have um so we would have had to break that in the inflate map is where you get populated.
Um, connections that target other maps.
Move where?
Um, where was that again? And again, apply. You are in You're in here in get connection parent tile which you get from here. Clear connection parent room tiles get connection parent tile. So at the very very beginning we have a connection data connection table connection ID connection table connection ID is their parent rooms ID.
Um, it have to be an inflate. Have to be inflate map. Here we are.
So, we go through our connections.
Connection data table. Connection ID is equal to connection.
And then we go through our rooms.
Room table.
Um, let me go back.
It's in connection table though, right? Connection table.
We clear you here.
Um connection table. Connection table right here.
So we go through our connection ids in the tile when we inflate this from the file data um connection data table connection ID.
This is our temporary table.
We didn't see a bunch of warnings.
So, it should be in connection data table.
Um, tile data add connection. This connection and then this is you in the room model.
We put it in the correct place. And then connection table connection ID which should be you is tile data uyu ID which should be you.
What would have h how would that be?
What happened there?
Um how they uh room table.
Um connection table connection. Yeah, you should be.
Oh no. I'm so dumb. I'm so dumb.
I've done this in the wrong order. We took you out right there.
What a dummy.
Let's try that again, shall we?
Aha.
You though aren't going away.
Is that because Why would that be?
Cuz when we click on you, delete connection for vector.
me reset. Let me make sure actually that uh yeah fine. Make sure we got all new code running.
Jim you south deleted still in still here west not here. Interesting. Okay, so we've removed you.
Delete connection for vector.
I get my connection tile.
This has to be in remove you from here. That's accurate and correct and good.
Um, update adjacent connection tiles in my offset location here of the parent room.
No, this is Dart.
Um, you update connection to neighbor location, right? You're just a little helper to do this.
Um, which actually that gets us back to what I was saying where I was thinking this needs to be this shouldn't be needed, right?
Cuz we've cleared you here.
So theoretically that should be able to go away.
Now, would that be causing this problem?
I don't think so.
But it is. Okay, cool.
We have problems here though. Duplicate.
He's found.
Okayum.
That's not good.
Everything is broken.
What happened there?
Why would there be a duplicate key?
Go back here so we can delete you.
Duplicate keys found.
Where is the duplicate key? Room data form.
Room data form has decided I have a duplicate key.
And it won't tell me, will it? Um, sidebar forum field. Oops, that's not at all helpful. Thank you.
Um, you're not going to tell me what that key was, are you?
Gross instance of connection data. Multiple children with key instance of connection data. Well, that's that's should be fine.
And I don't see how that would have been the case. Like I don't see how that would have changed.
We go through our selected task room data cardinal connections.
key value key on con.
So, how would you have the same value key in there?
That should not be the case.
The only difference is that we used to go through map state connections and now we do selected tile which gets reset when we do this work.
Um, why is that bad after changing but not before? If it was bad, it should be bad, I would think.
Why would that not be?
Um like that shouldn't be changed.
This may be related to whatever we have that's making this expanded. Let's let's take care of that really quick. Why are you all expanded by default? Let's start there perhaps.
Um, maybe that's just a to do with our switch over. That seems weird. Um, it wouldn't be this. It'd be connection tile form view. It'd be the actual connection data form, right?
Yeah, you are supposed to be context read app state map state.
expanded widget.connection.mmodified or widget.connection new connection.
We feed you a connection here.
So when we select you You have to come in through here.
Um, room data. Cardinal connections.
connection data has new connection is false. If it was being set to true somehow, then we would see this being set. But we're not widget.connection modified or connection new connection if it was modified.
I wonder if that's it right there.
If I was to do that. Okay. So modified is getting set somewhere on that connection object.
Modified defaults to false.
But actually modified has almost no utility anymore because um changing clicking on a different thing no longer preserves that state because we drive it off of the room.
So, if nothing gets applied, then clicking away and back in won't matter. Um, if it's new, we still want it to up here for sure. So, if I take that away though, then these are broken and that's okay.
Um.
Oh, no. We used it there.
I see.
That's a compelling reason to not make that change, for sure.
So, let's put you back.
I'm still confused as to why you're being set as modified.
Um, I can clean that up while we're here.
I don't want to worry about testing too much just yet. Um, why would modified beings set? Uh, it would have to be in Does anything set you in here? No, we let other things drive that decision for us. Um, nothing calls modified in here, which is where I would expect to see it.
Um, nothing in there.
What the hell?
connection data.
Um, not you, but um, room data for modified.
Nothing sets you here.
So, it has room data.cardinal Cardinal connections connection data form key is the value key connection is con here and see if we can catch it.
Uh, so here I can't move that when I'm in debug.
Um, connection data.
What I actually want is this cardinal connections.
Uh, oh, no, no, no, no, no. Map states.
Map state selected tile cardinal connections modified is true.
How is that happening? Okay, so we know it's here.
Um, stop that.
It's got to be in where we clone. It's got to be a clone. Clone clone clone clone clone.
Um, which will be in my connection data. I got too many things open again to JSON connection vector clone ID.
Yes, we don't clone here.
I don't know why that would default to true though.
Let's take a quick look.
Stage provider set selected tile.
Oh, it could be in room to clone connection from source cardinal connections.
That shouldn't be the case.
Um, let's do this.
You You uh you That's right. I can't move you. I always forget that. Selected.
Um, cardinal connections modified is true here already.
Interesting.
Okay, this is map and also we should do um get tile here at UI grid location. So that's going to be this.
Let's make sure that it's still pulling a um a room with the modified set selected cardinal connections modified is true. Okay.
So, let's go up.
I don't um Hang on. We got to close some of this stuff. There's too much stuff open right now.
There we go. Um, map controller.
Theoretically, this should be a problem on everybody.
It'd be an inflate map.
We do this. It's um room data from JSON.
Uh what be that? Um tile data add connection this connection.
Cool.
That's fine.
connection tables connection ID is that tile data connection ids connection data table add tags if no.
Um It wouldn't be in our constructor, would it?
Modify is false.
Shouldn't be there.
Check here, I suppose.
See if it's present.
This um map data. Oh, there you are. down here.
Map data connections.
This is my first map. Modified is false here connection table.
This should be the second map but modify is false.
Also check our Uh connection data table wouldn't be on this map.
I need to go through there once. It'd be on the other map. Uh so here we go.
Now our um connection table connection data table could be in here.
Why are you not set now? You're set.
Modified is false there, too. Okay.
So you can start and load um suppose it would be Where would that be?
They don't call modified here at all in this entire file.
Let's go let's look at it from a different angle. Um connection model modified find usages value write map diagonal except dragable and update connection.
Neither of those should be getting called.
Oh, wait, wait, wait, wait.
We do call you here.
Okay, that's why. But that should have been getting set all along.
We must have been clearing it on them or something.
by accident. Um before when we had the list that we pulled out, where else do you get called?
H uh where else do you get called? That is uh editor map in this inflate app.
Does it make sense to have that in there at all anymore?
Probably not.
So you used here and update connection tile.
I think we just take it out of there um and set it in the UI when it makes sense.
You're still expanded though.
Thought I restarted. Maybe I didn't.
Let's make sure. Fact, I know I did. Why is that still irritating?
Okay, so update that is taken out. Um, where else do we end up using you?
value. Right.
Accept dragable.
I accept dragable update connection.
Oh. Um cuz I need to do it.
Yeah, I need to do it in all of the different models. Duh.
Because they don't inherit because they have different diagonal this horizontal.
We need vertical um because they're different models.
you. There we go.
Now, now you're collapsed by default like you should be.
If we delete south, we still have a duplicate key found here though, and that's not good.
Um column direction vertical main axis assignment start children with key instance of connection data and my connection data should have um action model.
Yeah, you have equality and hash implemented.
We base you on ID, origin, destination, your tag list, your transit stuff, and your exit.
Um, instance of connection data data form selected tile as room data cardinal connection. Oh.
No, that should be fine. It's obviously not, but should be.
Do we somehow at this point end up with um additional connections in the list maybe?
So if we come in here and we select you the first time.
Uh I put that in the wrong place.
Select you for the first time.
Context. Um, map data section room data. Um, am I losing my mind? Where you at?
You're in state. That's where you are.
Map state.
Selected tile.
Cardinal connections. There's five of you.
Which?
One, two, three, four, five. Yes, that's correct. Um, the just play there.
Uh, delete you.
And then one, two, three, four. There's still five is from the south to the north. That's still correct.
But west to the east, I guess. Um, I need to look at what Con is Yes.
Con is connection data.
The south to the north. Okay.
East to the west.
West to the east.
There's our hidden.
Our other hidden northwest to the souththeast.
Uhhuh.
North to the south happens again. That's what's going on. Why are you Hang on.
Okay, whatever. Stop you. Debug you again. Why are you in here twice?
map editor.
Uh Jim.
So, let's make sure.
Uh not you. You. Okay.
Uh when I click on you the first time, this widget uh this map state rather um selected tile cardinal connections. There's five of you.
South to the north, east to the west.
Oh, you know what? There was six, but after what isn't there?
Okay, hang on. We'll play that south. Delete. Apply. U There's six. Now we've duplicated a connection.
A 809 946 A4 C uh 6 A4 C and then U or 6 A4C.
So, we're adding a connection along the way somewhere. That's what's going on incorrectly.
Okay.
So, it's in our controller. It's gots to be and it's gots to be in the delete of this fella.
Update tile. If it's staged for deletion, then we clear connection.
Parent room tile.
Get connection parent tile connection table con ID.
There we go. Get you from the room table.
Return it. Okay.
If it's cardinal, which it is, cardinal connections remove. Okay.
If the con data is cardinal this tile get connection tile delete connection for vector their connection from tables.
We return after clearing Why would that be parent tile? So we get ID to their parent room.
We know what the parent ID is.
Room table offset coordinates in the map room ID is to offset coordinates. So we get the ID which means we know where we are.
We throw an exception there otherwise get you as the room data parent tile.
And we deleted the southern connection so it shouldn't touch That guy.
Clear connection from tables.
Why would that be touching the room?
Like it's not even you get connection data or to connection to Oh, you know But connection tile plus the connection vector.
Delete connection for vector.
Um, this should be correct.
Let's go. Let's debug this.
I must be overlooking something simple and silly as one does in here into the gym.
Delete south again. Apply.
So this um con data is from the north to the south. Its parent should be 012 at 20.
It's going to think it's at one zero though. Okay, that's correct.
Uh, parent room tile cardinal connections. There's three of them.
I think it'll be you.
No.
This is incorrect. Location is one zero.
Oh, no, no, no. That's right.
It's just this right here. It's index one. Um, from the north to the south. Okay.
And it's in my cardinal connections.
So, after this, it shouldn't be.
And it's not.
It's been modified east of the west and then through my secret door test or my my heavy door test.
Um con data is still cardinal.
So we get connection tile.
This tile is a vertical connection tile model. That's correct.
North and south whatever that's fine.
We clear you from the tables which takes you out of there.
Destination table.
We clean that up and that's all it does.
So why would map at one one which is actually going to be 22 cardinal connections. Why do you gain a connection in that?
Let's reset you.
Let's double check.
Northwest, east, south, southeast.
That's fine.
Um That's weird.
Six.
One. One to one. Zero. That should be there.
1 one to 22. That should be there.
Wait, am I completely confused? Hang on.
One to one two should be there.
1 one to two one should be there.
1 one to 01 should be there.
1 one to one zero should be there. Okay, so that's all correct.
Maybe I'm losing my mind.
Um, so we do that and then Yeah, you're still sick. So that's not that's not issue.
One. One.
Size is six.
I was misounting. One, two, three, four, five.
One, two, three, four. There should only be five. That is true.
1. One to one zero.
That's one 2 3 4 5 1 to 01 true should be there.
1 one to 21 should be there.
1 one to one two should be there.
Um 1 one to 22.
Wait one to one 0 one one to two one one to 22. Okay. Yeah, that's still good.
11 one to one zero. This is the one that's duplicate right there. That's duped. Why is that duped?
It's duped from the get-go.
Sure. Let's reset. Reset everything.
Do this again. Make sure it's clean. If I click on you from the very get-go here, I can't Um, but I can see five connections here.
That's correct.
So, if I delete you and apply and we can take a look at you map at 22 has six already. Yeah, it happens here.
1 one to 0 1 1 or one zero rather 1 1 0 1 1 to 1 z okay so it's present there immediately even before we run through this so we know it's not in here Um, it could be in inflate.
You know what? Uh, I remember we had a check in here.
for the ID existing already. Why? And we got rid of it because that that shouldn't be happening. So why is it happening? That must be where it's coming from. Uh where is your usage is here.
Unclassified whatever unclassified this uh ad connection.
So that's in ad connection itself.
which might be a place to check tile data add connection this connection.
Okay.
But why would you be in here twice?
It's not in my file, is it?
Um, A2 F, no four. Uh, I don't remember the ID now. Gosh.
Uh, we can find out though. If we reset you and I put my um clear connection.
Put you back in here just for a second.
Delete you again. Boop. Come in here.
Uh you 6 A4 C 6 A4 C There are two of you. No, this is a map ID.
This can't be I must have used I must just copy pasted an ID from somewhere thinking that it would be okay because these look identical to Oop first 499 AE77 CB5 DC 094 94 68 Yeah, I must have just done that.
Um, I don't think that's my problem.
That doesn't seem correct, but um let me fix that up real quick.
Just give me a rando UU ID here.
We'll do that.
Wait, wait, wait. No, no, no. This is my Oh, I'm dumb. This is my connection list for the connections.
There should be two. I'm completely losing my mind.
Because this is this is the one that says this connection belongs to you and this is the actual connection. I Gez, what a loser.
Can't believe I just bamboozled myself like that. Okay. Um, so we still haven't figured out why we have two instances of this connection here. Um, okay. So, you're in here and nowhere else. There's not two instances of you on here.
Um, so where do you come from?
You still have to come from ad connection.
Um, find usages test map. Okay, fine. That's different map editor map type of game. A mud game.
Um add connection. We do that in inflate map. Okay.
But this is for connection ID in my tile data connection IDs. That should only happen one time.
Other place we do it is in here in add connection.
And you are my map editor.
Um, take take me here. Why aren't you want to open this in the real thing? Map state provider add connection. Okay, here I am here. That's why.
Um, but we've never used this in our test case, our test path.
So, let's get Foxtrat. Why are you in here?
You'd have to be somehow in inflate map connection ids is not empty.
I guess we can find out for sure. We can say if new connection ID um if our let's say cardinal connections contains this new ID throw exception um like so All right.
UID value isn't related to connection data. Oh, yeah. Yeah, we'd have to do this. That's okay. We can do that, too.
So, let's stop and restart you.
And we don't get that doesn't get through. So where the hell either this is wrong somehow.
Um so we can do Oh hang on. Actually I think I might have spotted it.
If we're on the same map, this then we add you to new connection.
Otherwise, that Nope, that shouldn't be it.
New connection connect vector card invalid.
Then we add you to cardinal connect.
Okay, so if we're not on the same map, there could be something there.
We didn't by chance recycle this onto the other map. Did we?
Oops.
Not you. You search place paste.
We didn't. Okay.
So, it's not that.
Um, how'd you learn to code? I want to get in the coding game too, but I don't know where to start. All good if you can't answer. No. Um, uh, by by coding basically is the answer. Um, so if you don't um have any coding knowledge at all, um, it's going to be a little tricky.
There is exorcism. So you can go in here, pick one that has a um learning mode right here, like something common with a learning mode. Um Go would probably be a good choice. Python would probably be a good choice. Um if you're okay with doing things that don't necessarily lead directly to games immediately, right?
Learning how to code is the is the tricky part. Um, if you need to go like for your own motivation, if you need to go into something that will uh immediately let you start messing with game engines, then it depends on your game engine. Um, obviously there's no um GDScript in here. I I say without knowing for sure. Shouldn't be. Yeah.
So, um C, if you're using GDO, you can use C. If you're using Unity, you can use C. But it depends, right? So pick a language with a learning mode that matches what you want to do basically.
Um GDScript is Python like so you might get some value there, right? Um and you can uh start working your way through some of these learning mode exercises and that'll help you to start learning what you're doing. Um but after that it's going to be like projects, right?
Projects are going to be kind of king.
um in general there's also road map right throw this in here for everybody's too uh so I don't know if they have a game they do have game developer right here so you can go in here and you can pick things to bone up on right this is all mathy stuff here though um but then there's game engine stuff. And if you click on these, they have free resources. Some of them have premium resources that you got to pay for. Others have free, some have both, right?
But that can start to give you an idea of what you need to kind of like look at. And you can see here you see C++, Rust, Python. I don't think I would start with Rust. Marco, you you you absolute troll you, but they'd include it here. Like it is it is a thing you could do. I wouldn't recommend it.
Um, but yeah, you can start kind of doing stuff and figuring out what you need to figure out with those tools.
Okay. Um why why you do this?
Let's see. Thanks. Great. Thanks. Yeah, absolutely. Uh got CSS and HTML locked in already. We'll check that out. I'm working on my company website. Cool.
Right on.
Um, so you didn't throw there.
Where the hell are you coming from?
The value shouldn't have changed.
And I believe we saw it even here. Let's double check my recollection.
Uh, we need to debug here.
Uh, here. That's fine. Nope. I need you to move because I'm going to need to read the screen here in just a second.
Click on you.
You didn't.
Oh, I put you in the wrong line.
Whoopsies. Try that again, shall we?
Right here.
This uh map state selected tile.
Uh cardinal connections. There's five of you. One, two, three, four, five. Okay, so at this point, you're correct.
Let's continue there.
And if I reselect you, there's still five.
If I was to click off onto that and come back, there would still only be five.
Okay. So, at this state, at this stage, I guess I should say, everything should be fine.
None of these things have caused this to mutate.
Add item call back shouldn't be engaged.
Um, should I be like map state would be a thing. Um, uh, reload map shouldn't be engaged.
Set and save tile changes.
Set selected tile.
Wait, wait.
Cardinals is from Cardinal. Okay, so that should be it.
And we don't see that when we click on it. It's only in save tile changes.
Update tile. Selected tile.
Update tile.
Your connection tile. I go through how to update connections.
I guess we probably start here because I'm really confused.
where 22 is getting mutated.
Still only five here.
If your stage for deletion, we clear you. Otherwise, we go into update.
It's right here. It's here.
Okay. So, we blindly engage this which is possibly not a great plan, but it's a cardinal connection. Update that table this at index. So when I go into here, um, okay. So hang on to we're somehow adding a duplicate connection here.
When we update a connection tile, duplicate connection to our room tile here. Okay, because it has been 4 hours and it's time for me to go turn on some AC because it's getting hot and sticky and muggy in here and it's miserable and I want some lunch. Uh, but I do this thing for roughly four hours a day, four days a week, starting to uh on Friday, ending on Monday. So, if you like this kind of nonsense, come on back around tomorrow, 10:00 a.m. Central time. I should be here doing it again, and I'd love to see you. If not, you all have yourselves a great weekend anyway. I will, I guess, you know what's left of it. I will uh catch you some other time on down the road. Thanks again, everybody. Bye.
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 views•2026-05-28
How agent o11y differs from traditional o11y — Phil Hetzel, Braintrust
aiDotEngineer
450 views•2026-05-28
Re: 🗣️📍theprophedu📍2026 GST 103 CLASS (E-EXAM REVISION)
theprophedu
636 views•2026-06-04
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Instagram accounts got PWNed
EricParker
13K views•2026-06-03











