Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411525 Posts in 69377 Topics- by 58431 Members - Latest Member: Bohdan_Zoshchenko

April 28, 2024, 03:58:51 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsM.I.N.T (Mecha, Infantry, and Tactics)
Pages: 1 ... 8 9 [10] 11 12 ... 26
Print
Author Topic: M.I.N.T (Mecha, Infantry, and Tactics)  (Read 70490 times)
Gregg Williams
Level 10
*****


Retromite code daemon


View Profile WWW
« Reply #180 on: June 11, 2013, 08:47:30 PM »

Another bit of a slow day between being wiped shifting back to euro time and a split sleep schedule, plus market trips. Still though, started in on the whole game instance structure of things, fixed a few bugs, and added thread switching into my game loops so that the game doesn't consume 100-200% CPU for no reason, and now uses about 2%.

I'm itching to get back into features, but really I'm swamped in a lot of important architecture design. While moving to MP was the right move no doubt, it also means everything I want to add to the game, has to be thought about, then added to the server side, and client side. So things are slower to implement in general. On the flip side though, what I do implement should actually be production code, unlike the direction things we're headed in, that would of resulted in a bunch of nice features in some sort of SP prototype, and then throwing away and re-writing all of it.

I also need to take a look at tiled, and see if I can find a nice way to mark tiles as valid deployment areas. I suppose this is likely going to be abusing another tile layer, since the object support in that editor doesn't quite seem to do it.
Logged

Gregg Williams
Level 10
*****


Retromite code daemon


View Profile WWW
« Reply #181 on: June 15, 2013, 06:21:17 PM »

Alright quite a bit of work done on this once again.

Now have the creation of game instances, clients able to join, response packets working, and am moving into game starting. My goal for this week is really to allow a game to start with 2 clients, the server to send each client a unit or units to deploy, and then go into a basic turn loop, that will consist of unit selection, and movement. Additional functionality will be built on top of this.
Logged

Gregg Williams
Level 10
*****


Retromite code daemon


View Profile WWW
« Reply #182 on: June 15, 2013, 09:51:32 PM »

Hacked in really nasty deployment zone support for 2 player maps Roll Eyes tiled and me continue to fight to do things nicely, but it'll work for now.

Also fixed a little bug in the packet reader class that was always having the reader start at the packet length index. When it should only do that for variable length packets. For fixed packet sizes, it makes sense to just start the reading offset at the data, as reading the packet is always identical.

Finally also made the server properly dispose of disconnected connections. Before they we're just hanging around in a queue to be disposed, but never being processed.

Next step will be to send the connected clients a deploy X unit command, write the client state for that, and some camera code, then have the server verify a response and both server and client place a unit there if valid.
Logged

Gregg Williams
Level 10
*****


Retromite code daemon


View Profile WWW
« Reply #183 on: June 16, 2013, 05:31:14 PM »

Alright finished the initial camera work for scrolling to a given destination. Its smoother when not being video captured.. but I think the capture turned out pretty decent overall. Some basic easing in and out for camera take off and arrive.


Not sure what other camera functionality is needed at the moment, possibly a follow target function, but I'm not sure if will need that or not and its minor to do anyways.

Onwards to actual unit deployment, and turns.
Logged

Conker534
Guest
« Reply #184 on: June 16, 2013, 06:41:18 PM »

Thats solid
Logged
Gregg Williams
Level 10
*****


Retromite code daemon


View Profile WWW
« Reply #185 on: June 17, 2013, 09:22:54 PM »

Alright client and server now move into deployment phase, the client camera scrolls over to the deployment zone, valid deployment tiles are drawn. Client also shows the unit type to be deployed which is snapped to the grid based on the mouse as it moves.

Client can attempt to place the unit, and the server is validating if the placement is legit or not.

Next step is for the server to create an actual unit on the server side if the placement is valid, assign it a serial number, assign the owner to match the placing client, and send the client a packet to add the unit to their world state. Or to send back a rejection notification to the client if its an invalid placement. Or just terminate them Smiley Client side code checks this already, so for it to be invalid.. means someone is trying to do bad things.

Progress seems slowish, but than again, I am writing a client and server at the same time. Also trying to balance proper long term coding design, and that of hacking. Its a lot of juggling as a ton of pieces simply don't exist yet, so I can't even begin to write a full fledged proper implementation, yet I still need a starting version to build upon.


The image above is what the initial deployment looks like at the moment, I really should do something like maybe grey scale out the unit, vs alpha, and custom mouse cursors would be very nice. Also will need some sort of 2nd step to allow setting of directional facing, though that may wait until a later version of the game for the moment.
Logged

Gregg Williams
Level 10
*****


Retromite code daemon


View Profile WWW
« Reply #186 on: June 18, 2013, 08:39:18 PM »

Alright deployments are now working. The server creates a new unit instance, assignes it on the server map, and send the basic info of the unit to the players connected. (normally this wouldn't go to all players, as units will be hidden via LOS and fog of war/etc)

Turn progression is also working, and clients can end their turn, and it will correctly go to the next player.

The next big step which I had hoped to wrap by tomorrow, is the actual mouse handling for movement, and pathfinding. It looks like though that I'll be spending the rest of the week on that.

There is a ton of design questions, which I haven't quite settled yet, that concern how movement and pathfinding are handled. Primarily being how to handle interrupts, and keep everything in sync. Interrupts being things like enemy units in over watch, and taking reaction shots as a unit moves into their line of fire, enemy units being revealed as you move, and then potentially also re-hidden.

Polling the server per step taken, seems quite wasteful, so I suspect the solution, will be processing the entire simulation on the server upon the move request, and then sending back the client some sort of command list and associated data. Like proceed until step 4, pause, unit X is revealed, Unit X does a reaction shot of type Z, unit suffers Y damage, unit is destroyed.  

Well see what happens with that, I suspect the command driven approach would be ideal anyways, if we want to allow async play. I've done games like that before, and just having everything end up in a command queue to process usually makes things fairly simple.

I'm also hoping to reveal some new art even if not completely polished, once the movement is in, which might just change everything. Smiley
Logged

Conker534
Guest
« Reply #187 on: June 18, 2013, 09:06:32 PM »

Hell yeah
Logged
saibot216
Level 10
*****



View Profile WWW
« Reply #188 on: June 19, 2013, 02:05:43 PM »

I'm usually not too into strategy games, but this has grabbed my attention. Very neat stuff.
Logged

Conker534
Guest
« Reply #189 on: June 19, 2013, 05:51:22 PM »

i dig the hell out of this

huge advanced wars fan, really really looking forward to this game.
Logged
Gregg Williams
Level 10
*****


Retromite code daemon


View Profile WWW
« Reply #190 on: June 20, 2013, 06:57:31 PM »

Alright bit of an update, feel free to skip all of this, if you aren't interested in technical design or discussion.

I've spent a good chunk of the day today, thinking about the various movement issues, and really the whole client synchronization issue in general. I even took a look at how some other titles handle this like Battle Academy, but was sad to find that they seem to let the client be authoritative, and within a few minutes I was able to cheat in online MP. Which is certainly not what I want for M.I.N.T

So I ended up writing out a couple pages in the ever growing M.I.N.T technical design notebook (Seriously I'm up to like 16 or 20 pages of tech stuff now, which blows my mind a bit.), and came to a a solution ultimately.

1. When a unit is moving, the unit will stop its movement if it sights a new enemy, or if it comes under fire during movement. The general plan at the moment is to have an Action Point pool, and if you want to move, you spend an action point and this fills a movement pool up with X level of points, based upon the units move rate. Your then free to spend those movement points whenever, or add more by spending more AP. So in the above scenario you might attempt to move 6 tiles, which we will say is going to cost 6 movement points for example sake, but on the 3rd tile moved to, a new enemy came into view. As such your movement stopped, and you only are down 3 movement points instead of the full 6. You also now can react to this new information however you deem.

What I really like about this, is it empowers the player, and speeds up turns. Smart players that are being careful would normally just move one tile at a time creeping to where they want to go. Now no one needs to do this, and its built in.

2. Now we have the problem of client/server synchronization. The solution I've decided upon as I talked about slightly before, is to switch to a command queue based client model. So what does this mean? Lets look at a simple example:

Client A: Sends a packet to the server requesting to move to destination x/y
Server validates if the move request is valid, if so it begins running the simulation on the server side. This means it generates the path on the server, and moves the unit along it tile by tile. Each tile moved it subtracts a movement pool point, and does things like check if new enemy units are visible, or reaction fire is occurring. Lets say this results in something like Move North, Move West, Move NorthWest, New Unit spotted, at which point the simulation is suppose to stop.

Now thats all fine, but we have the issue now of how to send back to the client all of this information, and make sure the client is synchronized so that they don't for instance draw the new unit spotted, before moving all 3 steps, there is also the issue that so far the client has no idea how many instructions it should be expecting from the server. So it might start immediately moving upon receiving the first Move North instruction, and then think its done.. as the following additional instructions got delayed for some reason.

Enter the command queue. With this flow, things are the same on the server side more or less, accept for every packet/instruction we would normally send, we instead add it to a command queue type container. Only once all of the simulation has been processed the command queue on the server is processed, and the first packet/instruction generated, is an instruction for the client to create a new instruction queue, that will contain X instructions/packets.

Now the client side when issuing a request, can simply enter a waiting for response state, it will receive the new "create command queue" instruction, and continue to wait until X additional instructions/packets are received and entered into the command queue. At which point its simply a matter of popping off each command which is really a packet from the queue, and handling it. We now have perfect synchronization.

We further are also able to mark packets if they are command packets, or not. This way something like a chat message is marked as a non-command packet, and is immediately handled and displayed, even when waiting for additional commands to arrive to finish a pending queue.

The trickest bit of all of this is really just handling the data that also goes to other players. You don't want to share that Client A's unit Y is moving to here and there, etc. Unless that unit is visible, or will become visible to a unit owned by that other player. Not doing this, allows for the creation of cheats like radar, or simply ignoring visibility and LOS and always drawing enemy units, even when you can't see them. Its vitally important to only send exactly the information a given client needs to know about something in order to prevent cheats.

Anyways that was probably to long, and I don't know if these long technical dumps really are of that much interest to anyone either Smiley I should probably start to actually implement all of this now.
Logged

Conker534
Guest
« Reply #191 on: June 20, 2013, 07:21:46 PM »

MAKE GAM >:O
Logged
nikolail
Level 0
**



View Profile
« Reply #192 on: June 23, 2013, 06:13:03 AM »

"M.I.N.T technical design notebook (Seriously I'm up to like 16 or 20 pages of tech stuff now, which blows my mind a bit.)"

That is quite archievement in my book, just imagine how much fun you have reading it from 20 years from now! And maybe ... share it it with fans in some nifty way?

Thanks a bunch for these fine detailed dev-blogs, i feel less stupid everyday :D I hope typing all this complicated issues also helps your tought process.
Logged
Gregg Williams
Level 10
*****


Retromite code daemon


View Profile WWW
« Reply #193 on: June 23, 2013, 02:46:58 PM »

"M.I.N.T technical design notebook (Seriously I'm up to like 16 or 20 pages of tech stuff now, which blows my mind a bit.)"

That is quite archievement in my book, just imagine how much fun you have reading it from 20 years from now! And maybe ... share it it with fans in some nifty way?

Thanks a bunch for these fine detailed dev-blogs, i feel less stupid everyday :D I hope typing all this complicated issues also helps your tought process.

Hmm share the great tech design notebook which I find hard to read my own writing in afterwards.. Perhaps Smiley

Yeah writing the stuff helps me as well to some degree.

Anyways sorry for the lack of updates, it decided to get fairly hot here, and the heat has pretty much rendered me into a state of endless sleeping and lounging around with zero productivity.  Makes me miss my 67f central air cooled house a whole block from the mighty intel mega campus. Now I have a window which I need to prop open with some object... Meh costs of indie life. Smiley
Logged

Gregg Williams
Level 10
*****


Retromite code daemon


View Profile WWW
« Reply #194 on: June 24, 2013, 06:26:01 PM »

Hrm started looking at implementing pathfinding more today. I had originally decided to just try an give Micropather a shot, but it seems it does a lot of caching under the hood, which is invalidated since every unit move, changes the state of the map. This would lead to me needing to clear the cache after every path, which then causes dynamic memory allocations and deallocs every time..

So time to roll my own A*, ideally that also does zero memory allocations during runtime.
Logged

marvinhawkins
Level 1
*


I love lamp


View Profile WWW
« Reply #195 on: June 24, 2013, 06:38:28 PM »

I like where this game is headed. Can't wait to see more.

Short version: Additional Compliment!
Logged

Gregg Williams
Level 10
*****


Retromite code daemon


View Profile WWW
« Reply #196 on: June 26, 2013, 08:12:53 PM »

Ungh well instead of working today on M.I.N.T I had to go to many markets, than have a starter short out in a parking lot, get towed, and repair the jeep. On the plus side I made my skill checks, and also didn't suffer any major hand wounds. Unfortunately, a rounded bolt made what should of taken probably 30 minutes, take 2 hours or so of rolling around under the thing on blacktop.
Logged

nikolail
Level 0
**



View Profile
« Reply #197 on: June 27, 2013, 01:47:05 AM »

Quite hilarious that your life seem almost as complicated than your game dev-blogs :D
Logged
Gregg Williams
Level 10
*****


Retromite code daemon


View Profile WWW
« Reply #198 on: June 27, 2013, 09:48:36 AM »

Quite hilarious that your life seem almost as complicated than your game dev-blogs :D

Haha! *sigh* it would be better if I was at least being forced to repair mechs.
Logged

Craig Stern
Level 10
*****


I'm not actually all that stern.


View Profile WWW
« Reply #199 on: June 28, 2013, 07:29:28 PM »


Oh yeah; unit deployment. I guess I should add support for that in my own game, huh. I keep forgetting about that for some reason. Huh?
Logged

Pages: 1 ... 8 9 [10] 11 12 ... 26
Print
Jump to:  

Theme orange-lt created by panic