(Almost) seamless transitions, mod/expansion support, and more...

Published April 10, 2011
Advertisement
I'm not dead - I just haven't haven't posted for 2 weeks. wink.gif

I've made alot of progress, but alas! I have no pretty pictures to show you. Instead, I'll talk some about what I've implemented, and how I hope it'll help my game be successful.

[hr]
Seamless transitions

First and forth most, my game world is divided into 'areas', and an area is broken up into chunks that are 20 by 20 tiles. An area can have as many chunks as it likes. The player is always at the center of a 3 by 3 grid of chunks - the 9 chunks that are currently loaded. I've been working to optimize the loading of chunks; when the player crosses a chunk boundry, there used to be a very big pause as it loaded the new chunks (part of the pause was me forgetting I was running debug mode tongue.gif).

I've cut down that pause a great deal (some silly mistakes that were wasting speed, but also some clever optimizations), and it's now only 0.05 seconds on average, though it's still noticeable, and some chunks are taking up to 0.15 seconds. I want to get it down to 0.01 on average, if I can. My game needs to support older computers if I hope to make a profit, and some of my areas will be much higher detailed than my current test area (though I don't anticipate much of an problem for higher detailed chunks).
There are still a few more optimizations I want to implement before I consider some of the more drastic and dramatic optimizations like multi-threading the loading or loading more chunks that the basic nine while the player is walking around.

I can now walk across a (nearly!) seamlessly scrolling area. The only 'transitions' in my game will be (due to design choices, not engine limitations) transitioning from places like towns to the outside, or from plains to forests, or from the outside of towns to the inside of buildings. I personally feel these type of 'area' transitions are important to giving the player a sense of indentifying areas.
I could very easily make my entire game take place on a single giant seamlessly scrolling area, at no extra performance costs and no extra work coding or mapping the area - but I actually *like* the feeling you get when crossing over in a 'new' area while playing a game. I also like the feeling you get when 'exitting' an area you were training in, giving you a sense of 'relief' from the dangers of that area. I greatly enjoy knowing that I 'made it through' a dangerous area that I was travelling through - it's a feeling of victory and relief. That solid boundry line between areas is important.

[hr]
Game flags system

Another thing I've been working on is a single system that gives scripts a great deal of access to valuable information.
It's basically just a tree of key-value pairs that I'm going to use for storing quest information, player stat and equipment information, and all sorts of data.

It looks like this:
[color="#006400"]Game.World...myFlag[/color]

The game flags don't dictate that you store the information in any sequence like 'Game.World.Nation.Area', that's just something I'll make myself and any other script writers adhere to for organization. Scripts can read and write to any flag, unless the flag or one of it's ancestors is read-only or blocks creating children.
The ones that are read-only are (some of) the ones that the engine creates itself. I use underscores to visually distinct built-in flags.

An example would be:
[color="#006400"]Game.World..._timesVisited[/color]

All the player's stats and skills will be built-in also.
[color="#006400"]Game.Player.Stats._strength[/color] (for example)

Hopefully this will give the scripters a lot of flexibility while still maintaining readability of the scripts in the future.

[hr]
Game packs system

I've also set up a system for managing (user-made)mods and (official)expansions to my game. The game looks inside two folders (named 'Mods' and 'Expansions') for game packs. It then builds a list of them, and establishes a generic 'order of importance' for them.

The (as yet unmade) menu for the game packs will look something like this:

modsinterface.png

(The game itself will not be able to be disabled)

This allows players to manually fix incompatibilities between multiple mods (if they, say, use similarly name filed or make areas with the same name) by choosing which ones get priority. This also allows mods to mod other mods, or 'graphic pack' mods to be applied even to other mods' areas. Further, this allows players to disable/enable mods at their leisure, even disabling expansions (or just one of the expansions) to play the purely original game if they want to.

When loading a file, it runs through the game packs that are currently enabled, and checks if the file exists in each of their directories, and goes with the file that is in the directory of the game pack with the highest priority.

For example, if I wanted the game to load file "Data/Tiles/Plants/LargeTree.png", it will look in these places, and will return the first one it finds, in order of priority first:
  1. [color="#008080"]Mods/Sammy's mod/Data/Tiles/Plants/LargeTree.png[/color]
  2. [color="#008080"]Expansions/Frozen Flame/Data/Tiles/Plants/LargeTree.png[/color]
  3. [color="#008080"]Mods/Merchantile upgrade/Data/Tiles/Plants/LargeTree.png[/color]
  4. [color="#008080"]Game/Data/Tiles/Plants/LargeTree.png[/color]

I can manually specify to look only at the directory of a single mod, expansion, or the game itself if I want, by specifying something like this:
[color="#008080"]/Data/Tiles/Plants/LargeTree.png[/color]

This makes the addition of expansions very easy to release. I don't really expect a lot of mods (or any) to be made, but implementing the features might encourage a small mod community to build around my game, which might help with sales. Since I get these modding features for free, while implementing the expansion system, I might as well add it and hope someone makes use of it.

The real benefit, however, is that I hope it'll speed up the process of releasing expansions. I intend to release two expansions to the game after the initial game is released: Two expansions expanding the world, and one free expansion expanding the game's content (adding new features and abilities). The free expansion will be given to you once you purchase the first two expansions.

[hr]
So yes, progress is being made. I'm working to complete my first major milestone (out of five), and I'm watching bemused as my 'todo' list to meet that milestone both shrinks and grows at the same time (thankfully, it's shrinking faster than it's growing. biggrin.gif).
While working on this milestone, I've implemented alot of things that'll help contribute toward the other milestones. I need to get this milestone knocked out soon, because until I do, not a single map can be made for my game - this milestone is holding me back from completing the editor.

Music is being composed by the composers, and my older brother is working on concept art for the main character. Someone is working on the plot of the game too, but we'll see how much of it I'll actually use. I'm not worried about it being high quality, but I am worried about it not being... 'my cup of tea', as the British say. (or as the Americans pretend that the British say, anyway dry.gif)

Once I finish this milestone and get the editor updated (current guestimation: Maybe a month), then I think I'll forgo working on the game's interface as previously planned, and instead work on the combat system first. smile.gif

Here's a picture of my game's main directory. I'm very happy with this project, much cleaner and better organized (both the files and the code) than my previous one.

mainfolder.png


Hopefully I'll have real screenshots in a few weeks. smile.gif
1 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement