Clearly, I need to work on the memory cleanup next.
Saturday, November 6, 2010
Friday, November 5, 2010
When I was playing Minecraft the other day, I realized the potential for this kind of engine. It would be a bit stupid if Minecraft and Infiniminer were the only games to ever use it, or if everyone had to write their own. (It is trickier than one would think.) So, I decided to make my own engine, which will be free to use and probably open source (eventually), and my own game with that engine.
The name Cyclopean Engine refers to cyclopean architecture, which is when a building is constructed from huge stone blocks, usually made to fit neatly together. The game will probably be called Cyclopean Adventures, and will have some Lovecraft-style horror in it if I can manage that.
While most of the game world will be strictly Cartesian and/or Euclidean, I programmed it with see-through portals in mind, so it will be possible to have areas linked in impossible ways by invisible portals you might not notice, deviating from Cartesian and Euclidean concepts of space. For instance, a mysterious house might be larger on the inside than the outside, and breaking though a certain wall could lead you to a different universe.
I could even make one side of the portal larger than the other, so that objects can change size when passing through, although building stuff will make even less sense then.
By the way, the zone which is rendered consists of 262144 cubes, but it only renders the possibly-visible surfaces, which is why it is fast. If one were to fill the zone with a checkerboard pattern of translucent cubes, it could become very slow indeed.
Thursday, September 30, 2010
Monday, September 27, 2010
It also now keeps the empires' knowledge of the galaxy separate from the actual galaxy data, allowing the player and AIs to have incomplete knowledge. We might know a star's color simply because it is visible from Earth, but we need to explore it to determine what kind of planet there is. Some stars will not be visible from Earth, due to astronomical dust clouds for instance, and will need to be discovered with space craft or seen from another planet.
I have switched over to pre-multiplied alpha in the renderer, but the textures are not ready for that, so no screen shot today. I have also made a plan to speed up the renderer. It runs very well on slower graphics cards, while ironically going slow on my very fast PC. I think this happens because it sends a separate polygon batch for each star. I have decided to render everything with little square images and pre-multiplied alpha, so I can send them as a single batch of quads.
Thursday, September 16, 2010
Unfortunately, the ramps still look a bit cliff-like. A have some ideas that I can still try out, though.
The generator used to create the 'rock' texture that I use in the image above is based on a variant of the fault-lines method, but adapted to be tiling and three-dimensional.
I also have a 'sand' texture, using the same algorithm, and 'glass' and 'crystaline' textures generated with an algorithm based on Voronoi methods.
The next task is to create a mouse cursor and to allow the user to interact with the terrain. This will allow me to enable the user to designate digging areas and similar orders.
Friday, June 11, 2010
Of course, eventually they won't be triangles, but rather textured quads with lighting. And there will be particles and special effects. And a story. And moddability! Stuff will explode!!!
Monday, May 31, 2010
The menu is working; including the switch to the combat test.
The combat screen is rendering, but without textures or lighting.
I am now working on movement, acceleration, rotation and collisions.
I will post screenshots and an explanation of the game when I have more to show.
Wednesday, May 26, 2010
The last few weeks I have been working on a much simpler game, in secret.
I got a big breakthrough in my work on OpenGL GUI components by reading an article or two about premultiplied alpha in textures.
The name 'premultiplied alpha' originally caused me to think 'Why would you want that?' When I discovered what it really meant, it became clear that I was thinking inside the box. Inside this box the name makes sense, but the concept seems useless. Here is the way out of the box:
Premultiplied alpha is actually a method to separate light that an object adds to the image from light removed by that object from the image. For instance, an opaque green object on a red background adds green light and removes the light from behind it, while a green flame would add green light without taking away any, and a transparent black object adds no light but takes away a portion of the background light. So now you can have all of these on the same texture, rendered simultaneously. Before, you would need to render them in separate passes and with different blending modes, easily doubling the amount of processing done.
Some more advantages are that textures with premultiplied alpha work well for stretching/shrinking the texture, for anisotropic filtering, and for DXT compression.
How it works is, the red, green and blue components of the texture only contains the amount of light added by the texture, and the alpha only contains the proportion of the background light to remove. So, for a non-glowing transparent object, it would be exactly like the normal texture, except that the added light is premultiplied by the alpha, and from there the name.
To render my GUI correctly, I no longer need to align the GUI elements' texels to the pixels, and it also does not matter if they stretch a bit, so I could greatly simplify the code. I have working buttons and images now.
I can now also scale in-game objects arbitrarily, and lighting is simpler than ever. I might not even need any shader programs at all this time.
Keyboard setup is working well, but I need to update my text renderer to use premultiplied alpha and fit in with the GUI components before I can make it possible to set it up from within the game.
Thursday, April 1, 2010
Thursday, March 25, 2010
I am working on a new map generator, and would like to hear any ideas that you might have. (Just post them in the comments.)
- Where you start should influence your strategy.
- Map features should cause interesting strategic situations.
- The map should be visually interesting.
- Objects in space (e.g. stars, derelicts)
- ‘Terrain’ types (e.g. nebulae)
- Younger stars near the centre, older stars on the rim.
- At least three types of nebulae: dark, reflective and luminescent.
- Stars inside or beyond dark or reflective nebulae are invisible over long range.
- The galaxy has a number of arms depending on its size.
- The gaps between the arms are large enough to be hard to cross.
- Nebulae cover the core and the gaps between the arms.
- There are cracks in the arms, creating choke points.
- Wormholes occur, as shortcuts and choke points.
- There are different kinds of ancient alien remains:
- Ancient Wreck – Free tech
- Ancient Ship – Free ship which can be scrapped for tech
- Ancient Ruin – (Guarded?) A planet with a significant research bonus
- Ghost Colony – (Guarded) Free colony with infrastructure and artefacts
- Ancient Factory – (Guarded) Free factory space station
- Ancient Refuge – (Guarded!) A planet inhabited by an ancient race
- If I add ‘exotics’ as a resource type, the sources will be black holes, cosmic strings, etc.
Depending on how the ‘huge galaxy’ idea goes, I might even add the option to have multiple smaller galaxies instead.
Eventually, there will also be technologies to allow civilizations to modify the galaxy in various ways.
Friday, March 12, 2010
Wednesday, March 10, 2010
My star name generator could previously only generate about 6000 names before reporting errors, if I recall correctly. This is a problem when there are a million stars.
The new generator can generate three kinds of names.
For the first ten attempts, it chooses randomly between a name sounding like a Bayer designation (e.g. Alpha Centauri) or a traditional name (e.g. Rigel). The Bayer-like name is created by choosing from a list of prefixes and of suffixes and combining the two (13200 possible combinations), while the traditional names are just chosen randomly from a list of 352.
If it does not find an unused name in these first ten attempts, it generates a random name that sounds like a traditional name.
Examples of Bayer-like names:
Examples of traditional names:
Examples of random names:
Monday, March 8, 2010
Friday, March 5, 2010
The Fortekri is an ancient species of intelligent social insects, divided into specialized castes. Their nature is such that they all care deeply for one another, and the things that they like doing most are also what makes them most useful. The workers like to work, the soldiers like to guard and to fight, the drones like to organize and invent, and the queens judge the drones according to their merits, choosing their breeding partners carefully.
The high queen is the mother of the queens, and the queens are the mothers of the princesses. Only the high queen may bring forth more queens. And only she and the queens may bring forth more drones. The princesses only bring forth workers and soldiers. The drones are always competing for the higher ranking queens, so that the best drones' genes may benefit the empire the most.
Drones without breeding rights are called taskmasters, and work directly with the workers or soldiers. A drone who is chosen by a princess is called a prince and organizes a group of taskmasters, or a group of princes. A drone who is chosen by a queen is called a king and organizes an entire industry, or an entire planet. The high king organizes the empire, and is of course chosen by the high queen.
Economically, they are very socialist. Everyone of all castes serve the empire, and the empire serves everyone. If there is enough food for everyone, everyone will have enough food. If not, then everyone suffers equally. This decreases the loss of population under harsh circumstances, allowing greater flexibility in which planets to colonize. Fortekri art is somewhat utilitarian, focusing on architecture and engraved signage.
Militarily they are also 'one for all and all for one'. The scent of their haemolymph agitates them, and, in large quantities, can drive them into a frenzy. This means that, when their soldiers' morale gets too low, they go berserk rather than routing, and they will always fight to the last man. This is not always the optimum strategy, so a part of a military drone's responsibilities is to make sure this does not happen unless needed. Their feelings toward each other (and thus, the empire) also make them very resolute fighters, entirely willing to sacrifice their lives for the greater good. If fighting occurs inside a Fortekri colony, the scent might also agitate the workers into forming a militia (armed with high-powered tools and military surplus equipment), but drones can order them to evacuate instead.
The main drawback of the Fortekri is that science and philosophy are only studied by the drones and only to improve the situation directly. Therefore their technology improves only in small steps, and not as quickly as most other species. Their civilization is well in excess of a hundred thousand years old, but only due to recent population pressure did they invent space flight and subsequent technologies.
Tuesday, March 2, 2010
There are currently 6142 names that it can generate. Here are some examples:
Most of these will not fool an amateur astronomer, but they are a bit more creative than they would be otherwise. And there are some surprises for the observant and knowledgeable.
The text renderer, however, was not working well. Even after debugging one could hardly read the text. It was using a method by which the computer draws the symbols with polygons. When drawing such thin lines as was required by the smaller font sizes, the rasterizer missed the polygons entirely, leaving out the lines. I will create a bitmap based text renderer for my next attempt, which should work very nicely.
Monday, March 1, 2010
- Less graphics programming means more game programming.
- It can already scroll, zoom and detect what I click on.
- It is much less ambitious.
- I am more certain on what I want to achieve with it.
- It should feel real. The planets and the galaxy should feel alive. I believe that this can be achieved by giving the people in the game a will of their own, and giving them a world to interact with.
- It should feel big. In a real galaxy there are billions of stars with billions of planets and it is billions of years old. While my game will not be that big, it should feel like it. To achieve this, I will either make the map really big, or create events and/or game play that relate the map to the rest of the galaxy. To make it feel ancient, there will be remains of ancient (but not necessarily dead) civilizations and the after-effects of long gone cataclysms.
- It should add a bit to standard 4X game play, maybe even add another X. Usually in this type of game you are either a powerful all-conquering emperor, or a member of an alliance fighting against such empires. However you unite the galaxy, you win. I will add a third way to play; spies everywhere manipulating politics and economies, even the planets that you rule will not know that you do. An important upgrade to the game play, which will make this possible, is the separation of government and people. This also ties in with giving people a mind of their own.
Friday, February 26, 2010
My next task will be speeding up the renderer. It is going at about 5-7 FPS at 800x600 at the moment, but I think it can go much faster.
I might also experiment with adding ramps.
Monday, February 22, 2010
Though you might not see much difference, the changes that I made are important during gameplay. All the stone type boundaries were off by a half cube along all three axes.
I had to modify the terrain shader program extensively, and unfortunately doubled the amount of texture memory required. This means that, to run on computers with 64MB texture memory, the application would need to use lower resolution textures. This is not a problem though, since I believe such graphics cards would not support my shader program anyway.
Friday, February 19, 2010
Afterward, I added the support for multiple rock types. It is not working nearly as well as this screenshot might lead you to believe. I think I should have stuck with red sandstone, rather than this yellow type. Also, the limestone is looking very blue due to the depth cue. I should fix that.
I am still deciding between using natural stone colors, classifying stone colors, or abstract stone colors.
Thursday, February 18, 2010
I also experimented with making the rocks less round, but did not meet with success. I will leave this for much later; there are more important things to focus on.
I will either add soil and sand next, or modify it to allow different kinds of rock with different colors and patterns.
Wednesday, February 17, 2010
Tuesday, February 16, 2010
I have been experimenting with different strengths of my current procedural detail-adder, but I think I should try to create a more rock-like procedure.
Procedural detail strength = 0.15:
Procedural detail strength = 0.5:
The lower strength gives a clearer image, but the higher strength looks more rocky. I'll be going with 0.15 for now, but I will reevaluate this when I have added some depth cues and created a more rock-like procedure.
The game was originally invented by my brothers and myself and was supposed to be a city-building game with ant-people, medieval technology, trade, warfare, magic and some machines. Back then I called it Formicarium.
Meanwhile, many many years have passed, and Tarn Adams and his brother Zach envisioned their own, similar, idea, and have actually implemented it. If you haven't tried Dwarf Fortress already, I recommend that you try it at your earliest convenience.
Having played Dwarf Fortress, and learned from it, I have decided to create my own game. While it won't be Formicarium, it also won't be Dwarf Fortress 3-D. Compared to DF, my development process will be more focused on tangible-during-gameplay results, rather than nifty tiny details.
Here is a screen shot of what I have so far. This terrain is full 3-d, like Dwarf Fortress would be with graphics, but not 2.5-d like most games. This means you can dig tunnels and build bridges as part of the terrain, rather than as separate objects. (not pictured)