Friday, June 8, 2012
The Final Project The Final Weeks
Right... So about this blog... Yeah I forgot to update a few times, but I didn't really do anything... Hopefully this massive post sort of makes up for it?
So I am not gonna lie. I messed up pretty hard. When it came to this class in the end. I literally did exaclty what you told us not to do. Wait until the last moment to get the project done. Well. I still somehow finished and I am actually quite proud of it.
I had a lot of troubles with it early on this week. One of the first things I wanted to do with the program was get it so tha the machines could connect. I first tried basing it off of the code for the networking take 2 stuff which was uploaded to the common by another student. but I quickly realized that that was a horrible idea because it was incredibly, incredibly convoluted and non transferable. I then saw the god like code called p2p example and quickly switched to using that. That was day 1 of my struggles.
Day 2 I spent all day trying to get the two machines just to connect to each other. A simple, make session and join session. I would make the session, but then I could not join it for the life of me. I couldn't figure it out until the next day. Early that next day I realized that I needed to called networkSession.Update() every frame, otherwise the remote player would never find the game at all. So I fixed it and I praised god that I finally made visible progress. I then spent the rest of that day getting it so that the player ships would move around. It turned out to be pretty simple since the p2p code was so visible.
The next day, day 4, also known as Thursday was interesting. I found out that the game was due at Noon on Friday. I was worried a bit, but I didn't let it stress me out too much. I just got too work. I was quickly able to get the ships to fire and lay mines. I had a good idea of how I wanted to do it and it turned out not to be all that bad for my implementation. I don't know if what I did was bad or not,but it works fine on a system link connection. Then came the biggest part of the problem for me, the data-driven conversion. I literally did not know what to do for this. I was really confused on how to do it. Luckily I met with some other people from the class and just chatting it out with them, turned out to help with my ideas. Glad I was working near others doing the project. I also then found out about all the extra stuff such as the checklist and video and stuff then. I got to say, I was pretty confused. Whatever, I got those done right before typing this up.
Anyways, I was still confused on the data-driven. It's not that I don't know what it is or anything, I was just confused on how you wanted it done. The instructions were pretty vague so I was just kind of doing stuff. I found that somebody had posted code which had a super solid queue class on it. So I implemented into my game. That saved a crap ton of time. I then implemented a two queue system. A get queue and a receive queue. The get queue gets the inputs from the handle function and then calls them and updates the ship. The The packet writer then uses the newly updated ship variables and player variables and sends them through to the remote player. The remote player gets that information and then writes them all into the receive queue. The receive queue then processes and puts the information where it needs to be. I think that it is pretty data-driven. It implements queue's at least.
I should also mention that it was a pain in the freaking ass finding a second computer to work on. I had to use a combination of the game dev lab, which was only updated because I directly asked the admin's to their face for help and my friend sam's computer to get it all done. God, I don't know how many times I had to set-up the environment this week. It was too many, but now I know that this is an issue. Learning. It is a good thing.
On a final note, I am never taking 5 classes in one quarter ever again. TOO MUCH WORK. I will say that that was the sole cause for me messing up a lot of stuff for not only this class, but others too.
I will say though that, through my struggles this quarter, I learned an absolute TON of stuff. I feel a lot more prepared for doing the DGE game after taking this class. I feel I proved to myself that I can figure this stuff out and do it. So I thank you for teaching the class. I found it to be fundamental to my understanding of not only network programming, but just programming in general.
Thank you very much,
William "Frank" Deaton
Thursday, April 26, 2012
Assignment 4 DataDriven
See I said I would get it done on time this time around!
Anyways, this took a lot longer than the other assignments, but I understand the concept I think. Shove instructions into a queue and then have a generic processing function take out the instructions.
I ended up learning a lot about some of the underlying stuff for c#. I have worked with it before, but I don't I have ever understood too well till now. namespaces are nifty little things I dare say. Also that all structs are actually derived from a single type called Object. That's kind of really freaking cool.
So yeah, for the most part. The test code that I used is the exact same as the test code given to us. That is... till I got to the interleaved part.
I was pretty confused on how the code was written, it didn't make a lot of sense to me. So I simplified it in my eyes at least. It does the same thing though.
I only have 1 queue instead of 3 and it is a queue of Objects. I just enqueue all the data as it is and then during processing I just check what type it is, Calc_Data or FSM_Data, and then typecast the Object Data and then doWork() on it. I honestly think it is pretty convenient, though I don't think you can do it like that in any other language since it abuses the all structs are Objects thing. Or maybe I'm wrong about that? Who knows, I'll get to it as it comes.
I don't know how efficient it is though because of the getType() calls, so that might be an issue if there was a lot of it.
I guess the other way would be to enqueue the two different types into their own queues, then have the interleaved q as a kind of marker q for the order that the stuff was put in and then during process you could just dequeue the interleaved q check what what type it was, then from that, dequeue the correct other queue. Though I think the dequeue calls would also be expensive so I dunno.
Pondering.
OH well. I got it working so I'm with this for right now.
Saturday, April 21, 2012
Assignment 3
Sooooo not gonna lie. I am late on this assignment because I derped hard and procrastinated...
I hate myself sometimes because this was way easier than I thought it was going to be.
I had missed class for the third lecture so I had to watch it to see what to do, but I freaked out because when I looked at the base code (which was practically nothing) I didn't know what to do. OF COURSE though, I didn't finish the whole lecture till this morning and then saw that you went over example code. I felt really stupid. So yeah, I copy pasted the code so that I could connect with myself (I only have one personal computer so yeah) and got the two programs to recognize each other. Once I had that done I started on just trying to send data across and got that working.
Then I realized that the server didn't know how many elements were in the list and that data was not stored on the client side either so I made a loop to count it. But then I realized while writing this that there is probably a function that does that. OH LOOK THERE IS. So I fixed that just now. Anyways, I then made loops to send and recieve the info as individual packets. This was a bit confusing until I realized that I had one of my pointers pointing to the wrong int so I was filling my whole list with list size. But I fixed that and then it worked. Then I found that there was a sort function so I used that on a list that I made one the server side and then sent it back and it did everything that I wanted it to do. Success!
So yeah, the only reason I'm late is because of my own self-machinations of laziness. I'll make sure this doesn't happen again. Thank god for slack days.
Monday, April 16, 2012
Assignment 2 Update
Yo, I just remembered about this. Darn it.
Anyways, I didn't have too many problems with this assignment at all. Turns out that I basically had done this before, albeit a little bit bigger in computer systems II, so figuring out how to do this stuff was pretty easy. I also had known about data alignment for a while because of a digital electronics class that I took so that was helpful too.
I did have some issues with Bird simply because I was being silly about the pointers, but then I figured it out. It's complicated, but not at the same time.
Outside of that, it was really easy for me. Don't know what else to say.
Anyways, I didn't have too many problems with this assignment at all. Turns out that I basically had done this before, albeit a little bit bigger in computer systems II, so figuring out how to do this stuff was pretty easy. I also had known about data alignment for a while because of a digital electronics class that I took so that was helpful too.
I did have some issues with Bird simply because I was being silly about the pointers, but then I figured it out. It's complicated, but not at the same time.
Outside of that, it was really easy for me. Don't know what else to say.
Thursday, March 29, 2012
Assignment 1 Update.
Yesterday I worked on this assignment setting everything up.
I joined the perforce forum and class forum and the website of course.
I was having problems with perforce till I realized that perforce was set up for me in my workshop class last quarter and behold! I found out my password. So I have managed to log in and change it to something that I know.
Downloaded Visual Studios 2010 pro. Sweet that installed all fine.
Did the pointer project. That was weird. I was doing silly things at first because my last real programming in c/c++ was comp sys II. But then I did things that make more sense haha.
Added XNA. Its about as visible to someone as I remember, which is not really.
Space wars compiled once I realized there were two solutions and I was in the wrong one lol.
This was the last thing to do. Yes
I joined the perforce forum and class forum and the website of course.
I was having problems with perforce till I realized that perforce was set up for me in my workshop class last quarter and behold! I found out my password. So I have managed to log in and change it to something that I know.
Downloaded Visual Studios 2010 pro. Sweet that installed all fine.
Did the pointer project. That was weird. I was doing silly things at first because my last real programming in c/c++ was comp sys II. But then I did things that make more sense haha.
Added XNA. Its about as visible to someone as I remember, which is not really.
Space wars compiled once I realized there were two solutions and I was in the wrong one lol.
This was the last thing to do. Yes
Wednesday, March 28, 2012
Subscribe to:
Comments (Atom)