About this blog
Beginning game programmer and musician, procrastinating extraordinaire.
Entries in this blog
So today I decided to implement this rendering list I've been thinking about for the terrain quadtree. After some mucking about I came up with a pretty awesome method that maintains a static list of nodes. This way I only add/remove nodes that have either become hidden or visible since the last frame rather than rebuilding the entire thing every time. This only applies generally to 10 or less nodes a frame so it ends up being pretty fast. Most of the nodes also stay in order which cuts down on the sort run time as well.
This bit of code isn't long, but I'm particularly proud of it for some reason:
private void FillList()
if (CameraManager.ActiveCamera.Frustum.Contains(mNodeBoundingBox) != ContainmentType.Disjoint)
mDistance = Vector3.DistanceSquared(mPosition, CameraManager.ActiveCamera.Position);
mIsListed = true;
else if (mIsListed)
private void RemoveChildren()
mIsListed = false;
You guys are probably starting to hate pictures of the same old terrain, so I promise this will be the last one. Tomorrow I move on to something new!
Just got back from a Radiohead show. at the hollywood bowl. fucking mindblowing. the bowl is a pretty awesome place as well:
exit music was great and is probably my new favorite radiohead song. they did a completely out of control version of idioteque. I felt like i was at a justice show. paranoid android is pretty much the perfect rock song. street spirit was another classic although I was really hoping to hear an acoustic version of it. the acoustics were busted out for wolf at the door and faust arp however. the show ended with johnny greenwood and ed o'brien doing a drum machine/synth "everything in its right place" jam which was a perfect ending to the night.
1. 15 Step
2. There There
3. Morning Bell
4. All I Need
5. Pyramid Song
7. Arpeggi/Weird Fishees
8. The Gloaming
9. The National Anthem
10. Wolf at the Door
11. Faust Arp
12. Exit Music
13. Jigsaw Falling into Place
15. Climbing up the walls
17. How to Dissappear Completely encore:
Dollars and Cents
House of cards
Everything In Its Right Place
I finally put my jumbled weed-induced thoughts on the game in to something resembling words. I was originally opposed to this explanation because of all the shit people trying to make online RPGs get, but here it goes:
It's going to be a online action RPG set in a fantasy world. There will only be player vs player combat and I want the gameplay to be fast, almost on the level of a FPS. It will be based around nations fighting each other to take control of various points of interest (towns, towers, etc.), each of which will be in its own seperate instance. Guilds within a nation can claim locations their nation owns which will provide them with bonuses and a steady supply of resources with which they can craft equipment. Players will join instances through a battle.net style interface where a list of game lobbies will be displayed showing all contested locations a player can join. Characters will progress through a skill system based on PvP participation/results and a simplistic crafting system.
Because there are no monsters to grind or long roads to travel before you can do anything interesting, I'm hoping people will find this game a lot more accessible than the average online RPG. Resources will be gained through winning battles and owning locations over time rather than clicking on trees, and combined with the simplistic crafting system will make getting decent equipment not too time-consuming. Locations will be locked to a certain range of levels so players won't be playing against people far lower/higher levels than themselves. In this way everyone can contribute to their nation as lower levels will fight for outposts and towers while higher level players fight for castles and keeps which provide a greater benefit to their nation. Once a nation takes a certain portion of all locations (~90%?) the entire game will reset, ensuring no player or nation can become unstoppably overpowered. I'm hoping the game will cause players to feel loyalty to their nation rather than their character, eliminating any drama over character resets.
Now that that's over with, here's some secondary explanation. I understand I'm way out of my league trying to create this on my own. I also know the pitfalls of trying to make a team and developing online games. My current plan is to keep programming the game alone until I have something presentable, and then look into getting some artists to lend me a hand. It also helps that I have cut out many of the difficult aspects of online RPGs including content creation (no quests, only basic story elements, no NPCs whatsoever) and load balancing (the game instances can be very easily seperated on to multiple servers if needed, instances are capped to a manageable number of players).
I currently believe I'm capable of doing all or most of the programming on my own. There is still quite a long road ahead of me, but I can already see the small, dim light at the end of the tunnel. If you have any questions please feel free to shoot. I'm specially interested in any flaws you can see in the admittedly small overview of the game I've presented.
EDIT: I also noticed both imageshack and paint were blowing ass in their own special ways, so I switched the last couple posts to tinypic and will start saving pictures in GIMP. Here's detail mapping that went in before I pass out to honor the occasion:
All of these textures (four diffuse, blend, normal, detail) are really starting to slow down my rendering. hopefully sorting the quads will help this.
Still slowing bangin away on the terrain. I've changed my mind slightly about the type of game I'm trying to make which cut down on the performance I'm going to need out of the terrain a lot. For now I'm trying to work with just one 1024x1024 map in any one round.
Anyway, here you can see the 1024x1024 map working pretty flawlessly:
This is due in part to two things
1) Drawing from a normal map rather than storing it per vertex, which allows for much smoother shading (and I think better performance?)
2) Switching from VertexPositionNormalTexture to my own VertexPosition format which cuts down on the vertex memory by ~60%
Lastly, I integrated XNAnimation into my project which took virtually no time at all. I was seriously amazed at how easy this library is to work with and hopefully it'll work for everything I'm gonna need out of animation. Here's a marine from the DirectX SDK chillin at 0,0,0 during all my testing. I'm gonna need to get some camerachase action going on for this guy soon.
What I'll be working on: sorting visible quadnodes by distance before rendering, maybe LOD? (might end up not needing it and the problems that come with it at all), terrain movement, water, a map editor using Forms, basic networking. See ya in a few years!
Just a quick little update-
multitexturing is of course a lot more presentable than LOD, so of course it had to go in first! Here are some shots:
I pull three texture values from a RGB color map and fill in missing values with a backup 'dirt' texture. My plan is to allow each quadnode to set its own four textures which will hopefully be enough for whatever I can fit inside one of them.
I managed to implement a quadtree into the engine to structure the terrain. Currently I'm displaying 9 sections of 512x512 terrain which are split up down to 128x128 quadnodes. I'm hoping properly scaled this will give me a decent view distance and good performance. That combined with removing savestate from my spritebatch draws gave me a large increase in FPS. I'm still not doing any LOD although I plan on implementing a single vertexbuffer and many indexbuffers like this post: LOD. Thanks to the comment from my last post I also turned the depth buffer back on after spritebatch draw calls and fixed the transparent terrain problem. I'll leave you with some screenshots although they're not much different from the last ones (I got bored with the grass texture I was using though :p).
Up next is multi-texturing and some LOD
It's been nearly two years since my last entry, but I've decided to get back into the game here. I'm currently entering my sophomore year at UC Santa Barbara as a computer science major, just as I had planned back then. Though I was hoping to get into a hip east coast private school I couldn't possibly be happier with where I ended up. If any of you are thinking about attending UCSB I can attest to the fun you will have here :)
I looked back on my previous entries before writing this which were fairly amusing. However, it almost feels like no matter how naive I was back then that what I know now doesn't amount to that much more. Hell, I even managed to finish a game back then, which I don't think will happen for a very long time with my new project. Still, what I've managed to accomplish so far has been very exciting for me and hopefully I will stick with this for the long haul.
Anyway, I'm now working with the XNA platform, the ease of which has made transitioning to 3D for me an extremely pleasant experience. I think having started with this is going to make me regret having to go into openGL or DX some day (which will undoubtedly happen). I've mainly been working on back end stuff and implementing various graphical structures through a couple sites (roecode and riemers) and riemer's new book which I knew based off his site would be a good purchase (and was).
On my terrain system I've been working on I'm experiencing a wierd problem where terrain viewed from one direction will look fine, but turn the camera 90 degrees and I get wierd clipping/transparent terrain issues.
I'm hoping it's just the basiceffect being weird because when I render it as a wireframe it turns out fine.
This is turning out to be longer than I intended so I'll leave you with some cool pictures of a basic menu and some atmospheric scattering (both with a tip of the hat to roecode).
I've been reading SICP and watching UC Berkeley's videos on programming paradigms. It uses Scheme and starts with functional programming, something I've been finding very enlightening compared to the C++ stuff I've done (and fun!)
Just now I wrote an Nth root solver:
; find nth power
(define (nth x power)
(if (= power 1)
(* x (nth x (- power 1)))))
; find roots
(define (rootsolve actual guess prec power count)
(define newguess (* (/ 1 power) (+ (* (- power 1) guess) (/ actual (nth guess (- power 1))))))
(if (> prec (abs (- actual (nth guess power))))
(rootsolve actual newguess prec power (+ count 1))))
; less precise root
(define (root x power)
(rootsolve x (/ x 2.0) 0.001 power 0))
; more precise root
(define (root-prec x power)
(rootsolve x (/ x 2.0) 0.00000001 power 0))
And (root 25 2) reasonably solves as such:
> (root 25 2)
I just wiki'd an algorithm for nth roots, but I believe its a derivative of newton's method. The problem I'm having with it is for rather large values, say, (root 12844244 21), I'm starting at very poor guesses:
> (root 12844244 21)
is there a better function to find a decent place to start checking than dividing the input in half? Or some other fun things to do in Scheme?
I decided to try installing Ubuntu (my first shot at Linux) on my mostly defunct laptop (I spilled a drink on it destroying its keyboard functionality, so I have to use a USB keyboard with it). Getting the wireless network card to work with Linux has been loads of fun, no wonder so many people are making the switch.
But really, besides the frustrations with that I'm mostly optimistic for the future, and, should this test go well I think I'll be upgrading my desktop from windows 2000 to a vista/ubuntu or some other distro dual boot. If anyone has a recomendation for another interesting one please feel free to comment. My dad uses Suse, but after their whole sell-out to Microsoft I'm pretty sure I want to stay away from that.
Nanowrimo oriented, I pretty much gave up out of boredom with my story at the beginning of the weekend. The problem was I was trying to write a religiously-oriented (christianity) satire without any religious-background. I realized much of my humor was more mindless-drivel than actual useful commentary, and I couldn't churn out half-credible information on a rapid pace needed for nano. Also, I have so much to do in the beginning of senior year that it's really just poorly timed all around. I'll probably still write more in it and get to around 10k, but I've given up on 50k.
What this does mean is I can get back to programming, which is a good thing, because just having started so recently I don't want to lose my edge. And I think I can produce some good stuff before any of my interviews, which will be a lot more pertinent to the places and major (CS) I am applying to than nano.
Hopefully when next year rolls around I will find myself with slightly more free time and a much more nonsensical topic to write about.
As a reminder for myself:
-study for physics SAT (one month to learn everything I don't know - and I only learned mechanics in my physics C AP class)
-college brag sheet
-study for AD (fuck china...)
-write a novel in a month (nanowrimo)
Yea yea, it's easy compared to having a job or walking 15 miles through the snow uphill both ways just to get to school back in your day.
Just gotta get this off my chest that right now I'm pretty god damn stressed out.
I wrote a tic tac toe game yesterday so I don't get rusty with C++. Hopefully after november I can come back and start work on the new version of console combat.
Sorry, I was trying to come up with a really exciting entry name.
Anywho, I picked up the (YAY USED!) books:
3d Math Primer for graphics and game developers
Introduction to 3d game programming with directx 9.0
and will be working through them concurrently with my current Console Combat 2 project and finishing up C++ in 21 days (which is starting to seem like C++ in 16 days with a lot of random stuff thrown in at the end). I'm reading the math primer first and just finished creating a vector class which was bundles of fun:
It also helped a lot with my understanding of overloaded operators, now I'm the friggin king at it. It also feels good really understanding the proofs behind things like vector projection onto other vector so I don't have to resort to C&P without knowing what the hell I'm doing. Once I start the directx book I feel I'll be a lot better off learning the vector/matrix math beforehand.
In other news, college applications suck. Can't wait until I have them all sent out so I can relax for the rest of the year (until APs anyway).
I've completely my first game titled Console Combat 1. Yay! It's currently in the Showcase: Console Combat 1
Source code is included and it's licensed under the do whatever the hell you want with any of my code (not that you would want to use that ugly uncommented clusterfuck) license(TM).
Error handling is rather difficult in the console (mostly input at wrong times) so attempting to screw it up will in fact screw it up. I also couldn't figure out how to allow spaces in input for the name, so that's out too.
Overall though, I'm happy with how it turned out and it makes for a fun little 10 minute time-waster. I learned a lot about OO design and why I need to use more commenting next time around. I also need to abstract things better functionally as well because I had a lot of word-for-word rewritten code.
On to Console Combat 2.
I implemented my first hacky design today =D In the console combat game I've been working on, on the weapon dealer screen it shows your gold as a fake menu option:
I've also been thinking a lot about how I'm going to portray Jesus in the novel I'm writing in November. Right now I'm thinking it can go two ways: he can either be our common every day wholesome, good-natured Jesus, or I can make him completely badass (a la Shwartzenqweqweqew in Predator). Having Jesus scream, "Get to the choppa!" could make for a good story.
Seeing as my work on Console Combat 1 is coming to a close ("all" I need to do is implement the arena, easy right? ...) I've been bouncing ideas off myself for Console Combat 2 which is far more open ended. Right now I want the screen to look like this:
Which would be totally awesome if I did it, but might 1) be out of my league or 2) be too much for console output to handle. We'll see.
To succeed in life, you need two things: ignorance and confidence.
Hello citizens of gamedev, this will mark the beginning of my epic journey through developer journal land. I figure I'll just start with the basics on everything me and you leave you wondering why you spent the last couple minutes reading this.
I'm a 17 year old high school senior living in the very beautiful and smoggy Los Angeles. Today we experienced this wet stuff falling from the sky, I havn't been able to figure out what it is yet. I started getting really into programming just a couple monthes ago, having found the C++ Workshop here on gamedev. However, I first found gamedev a long time ago when I had started working with the Warcraft 3 map editor and more importantly its scripting language. I've also been doing hacky stuff with various languages for years.
What I've been working on recently is the first project of the Workshop, creating my first text-based RPG. Fun stuff:
Yay data processing!
My goal is to have this banged out in the next couple days, continue reading through the C++ book and then begin working on project 2 and eventually turn it 2D with SDL.
I'll also be doing Nanowrimo soon. I have my basic plot written down, involving the devil hiring a man to go back and stop Jesus from being killed. Hilarious events ensue. If you any suggestions feel free to volunteer them, as filling 50,000 words (~200 pages?) of storyline will be quite a feat.
Anywho, that's my first entry.
He giveth and He taketh away.