5 ms·
Let's Code... an MMO
- AlexC04 16y agoThis is really cool! I can't wait to come back and give it a proper read through. Hurry on weekend :)
- revoltingx 16y agoNeat explanation, 3D seems so complicated. I'm working on an 2D MMO myself, the client prototype is just step 1. http://developingthedream.blogspot.com/ http://developingthedream.blogspot.com/
- pixelcort 16y agoAs for an Octree-based implementation, http://sauerbraten.org/ http://sauerbraten.org/ comes to mind. Sauerbraten (aka Cube 2) also has a real time collaborative world editor.
- jerf 16y agoShamus Young has been doing a vaguely similar series lately, which you can find at: http://www.shamusyoung.com/twentysidedtale/?cat=66 http://www.shamusyoung.com/twentysidedtale/?cat=66 Note that that page, unlike most blogs, is sorted earliest first, so I'm actually referring to "Project Hex" at the bottom. Though you may find the others interesting too. Interesting to compare and contrast the two fundamentally different approaches, which nevertheless have produced reasonably similar screenshots initially.
- riprock 16y agoI've been looking into game programming in my spare time and I was wondering how to best implement the UI as a hobby project. I know there's Scaleform, http://www.scaleform.com/ http://www.scaleform.com/ , that's used for major games like Starcraft 2 but the price tag is way out of my league. Anyone have any suggestions?
- nihilocrat 16y agoA ton of UIs are built from the ground up. When you compare the logic and math involved to the logic and math used in 3D rendering or even 3D game logic, it's an absolute pushover, though you might feel like it's a huge hassle since in web development you get the UI logic, more or less, for free. You'll notice very quickly in game development that, until very recently and with the exception of graphics / sound libraries, you have to code everything from scratch. It really depends on the library/engine you are using (if you're using one!) OGRE3D integrates well with several packages, Unity has a builtin GUI system that is stupendously inefficient, and the list goes on...
- chipsy 16y agoIt's definitely a pain point for games that there isn't much choice around for general-purpose UIs. It's a big factor in why many indie games end up with really shitty, underdeveloped UI. Fortunately, you don't really need to reinvent Qt or CSS to get the job done. A font system and a few hand-coded controls usually suffice. I think the bigger problem is in sound synthesis and processing. This arena still remains mostly confined to reverb algorithms, crossfaded tracks, and pre-recorded samples, yet the depth of the subject goes about as far as graphics does. So we're really missing out in terms of applying technology to creativity here.
- barrettcolin 16y ago"Stupendously inefficient" is a bit of a stretch for me in regards to Unity; I think it has a fairly well thought out - if admittedly rudimentary - GUI system (in its second iteration, upon which the editor application interface is also built). "Efficiency" is typically not the foremost concern for the interface in a 3d game, anyway; though in that regard I also don't consider Unity to be a slouch.
- deleted 16y ago[deleted]
- stonemetal 16y agoI only know of a few, they tend to be other library specific. There is a ui add on for SDL. There is guichan if you are using opengl. CEGUI is the only one that I know of that has wide ranging support and is probably what I would recommend. You might also consider FLTK it is an app gui system not game specific but uses opengl to draw its widgets so it might be workable in a opengl app.
- feral 16y agoThe article is called "Let's Code... an MMO" - but it is just a simple Octree tutorial. I don't mean to be negative, like the guys friends that laughed at the project - but coding an MMO is several orders of magnitude more complex than putting together an Octree renderer. Best of luck with it, but, so far, nothing to see here.
- nihilocrat 16y agoWriting an octree is definitely part of coding an MMO. It's a piece of software, of which an octree or something similar is a fundamental part, thus it totally fits. If this is too slow-paced or ground-level for your tastes ... avoid game development, it just gets worse; more complicated, more pedantic, more detailed, more time spent not actually creating game logic. However, I'm also cheesed at the misuse of the term MMO, Minecraft is pretty close but the lack of a centralized game world in any way makes it unlike most MMOs, and by extension doesn't really fit the term. It is merely a persistent multiplayer construction set. N8 (Neverdaunt) or Wurm Online (which notch had formerly worked on), for example, are similar construction-oriented games that definitely fit the MMO moniker because there /is/ a centralized persistent game world. Dealing with the side effects of such a architecture does make things an order of magnitude more complicated.
- feral 16y agoI disagree where you say 'an octree is definitely part of coding an MMO.' An Octree is just one technique to reduce the size of the Potentially Visible Set of geometry that is sent to the rendering pipeline. While its a quite a natural fit for a voxel-style world, such as minecraft, there are many techniques to achieve this; an octree just being one. If the Octree was the core technical challenge and data structure used to create every MMO, then I'd have no issue with the article. But its really not - its a simple technique, graphics 101, used to speed up rendering (or collision detection). Further, just having an octree is not nearly sufficient for handling MMO scale issues - a lot more needs to go into structuring the world - when those larger challenges are solved, I'd like to read his article on it.
- angrycoder 16y ago
- daeken 16y agoThis is a pretty damn cool article, but it's an odd choice of bounding spheres for frustum culling of octree nodes. Yes, it's cheaper in terms of CPU time than using the actual octree nodes (which are either cubes or boxes -- cubes in this case), but it's far less precise, meaning you're going to be 1) checking more nodes, due to recursing further when you have a false positive, and 2) most likely sending more data to the GPU than required, especially considering the density of his world. Can anyone think up a reason why spherical bounding boxes would be beneficial here?
- davidsiems 16y agoA sphere-frustum check is a lot cheaper than a box-frustum check. The spherical test only has to check the distance of a single point to the frustum, a box intersection test is much more complex. There are some false positives, but as with many things in game development 'close enough' usually works pretty well. If you're really concerned with efficiency you should look into other data structures than an octree. Octrees are a nightmare for cache performance (like most other tree based structures) and cache utilization is usually the bottleneck on modern CPUs. If you're interested in the subject this book (http://realtimecollisiondetection.net/books/rtcd/ http://realtimecollisiondetection.net/books/rtcd/) covers everything extremely well.
- daeken 16y agoYea, I know sphere-frustum checks in and of themselves are cheap, but when you consider the cost of false-positives for octree traversal and the cost of sending unnecessary data to the GPU, it doesn't seem like it makes a lot of sense to me.
- davidsiems 16y agoThen it sounds like it's time for an experiment. Take the code he posted with the article, and modify it to use a box-frustum check instead. Don't forget to test the program's performance before you make any modifications so you'll have something to compare to. Even better, keep the code intact and #ifdef'd out so you can toggle between the two. Then, compare the differences. Check to see how many false positives there are on average, and how much extra data this means gets sent to the GPU. Keep in mind, however, that extra data being sent to the GPU doesn't matter unless the GPU is actually the bottleneck. My hypothesis is that the way the octree abuses the cache will overshadow the performance gains (if any) you'll make by using something other than spheres for your test. In the end you'll find that if performance in this part of the code is a problem, you'll need to switch data structures.
- alkavan 16y agobeen checking some simple game development solutions in my spare time ... been looking into SlimDX, and then discovered pygame - http://www.pygame.org http://www.pygame.org, works on linux and windows, it's a Python based lib, now i dunno python but it was really easy to start crating nice stuff in no time.
- daeken 16y agoPygame is a great way to get started quickly. Once you move into the 3d world, though, I seriously recommend pyogre (and its bindings for Bullet and all that). You won't get the knowledge of how to write your own engine, but if you want to do some awesome gamedev with minimal time sunk, you really can't beat pyogre, IMO.
- Jach 16y agoDo you have any thoughts on Panda3D? Like pyogre it's a C++ framework with Pythonic bindings on top. I think the most fantastic thing about Pygame is the huge library of open games on its website. I wish these 3D framework sites had that.
- daeken 16y agoI have looked at Panda3D, but I haven't built anything with it, so I really can't compare the two very well. That said, Panda3D's goal is to be a game engine, rather than just a graphics engine, as with Ogre. I imagine between that and the poor documentation for pyogre, it may very well be easier to get a game going with Panda3D. But personally, I love ogre and the bindings that pyogre provides to other libraries, e.g. Bullet, make my life damn easy. Also, the documentation issue is an issue, but most things are wrapped so closely to the C++ counterpart that you can just use the Ogre docs and be fine. I spent a couple days writing wrappers around pyogre to do things like game state management, nice GUI APIs, etc, and after that it was clear sailing. I wish I had more time to work on the game all that stuff was for, really, but such is life.
- swah 16y agoI was thinking of (one day) creating a "Let's build a" series in the following order: 1) Students learn about assembly, opcodes, etc. They write programs for an imaginary machine and only run them on paper for now. 2) Students write their own CPU emulator (in C) that can run and test the simple programs from 1. 3) Students write a compiler to a simple HLL which allows them to write more complex programs, and test against the emulator. 4) Students build the processor which was being emulated in HDL, and download it to FPGAs, testing outputs of the programs generated by their compiler against the emulator. I think most schools already do something like this, but mine missed the compiler part.
- wtracy 16y agoI would be interested in reading that. :-)
- rcfox 16y agoI've also wanted to develop a series like this, where each course builds directly on the material from previous courses. My school offers each concept individually, but they're not related.
- corey 16y agoCheck out The Elements of Computing Systems. It walks you through the construction of a computer starting with just NAND gates. You start by building other logic gates, and then an ALU, CPU, assembler, virtual machine, a compiler for a simple high level language, and finally an operating system. Each chapter gives the necessary background information, and a specification for you to implement.
- hristov 16y agoI actually took almost all the classes necessary to do that. I could even go further, I took classes that would allow me to design the processor on individual transistor level creating a design which could theoretically be built on silicon. But of course the classes were separate so I did not build upon everything. The problem with that is that encompasses what have become two disciplines -- computer science, and electrical or computer engineering. I took classes encompassing both sides because I liked the classes, but most people are really interested in one or the other.
- Roritharr 16y agoHonestly i don't believe that he will get to the point of having something playable. I watched too many projects like this fail and some succeed. Those who succeeded all did NOT focus on their technology when talking about their project and seemed to focus more on getting it to a point where you could actually play something. Of course you'd think that for a mmo a good technology base is key, but it isn't because if you're honest: Your mmo won't attract a that large crowd in such a speed that you won't have time to merge to something better and spend the money you've earned from your customers of the first hour on improving scalabililty. Find something fun, get it done and then make it work would be my advice to any aspring independent gamedeveloper.
- binaryfinery 16y agoOh piffle to all you nay-sayers. Look at what he's done! What fun! How great it is to zoom around a world entirely of your own creation! Who cares about the rest? Not me. Sure, I would have just used a 2D structure instead of a 3D one, and maybe experimented with hex maps instead of squares, but this guy now knows more about 3D oct-tree terrain rendering than I do, and anyone who has commented so far, I'll wager. Creation is never to be sniffed at.
- donaq 16y agoUh... I'm getting a 404 for this.
- phoenix24 16y agome too
- omouse 16y agoWhere's the maths?