Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - koiwai

Pages: 1 ... 5 6 [7]
91
Early Dev / Re: Wanderers / open world RL
« on: February 25, 2014, 06:43:40 PM »
The movement system sounds awesome! Can't wait to compile this thing :D

Weird, I tried again and this time I got this error:
Quote
ocamlopt -c -I lib/ -I src/ src/view.ml
File "src/view.ml", line 381, characters 2-12:
Error: Unbound value List.iteri

My system is some old Ubuntu with Ocaml 3.12.1

I see. This an understandable error. List.iteri was introduced in 4.0.0.  But 3.12.1 is not that old, still I was using some functions from the 4+ version.

Maybe, I should try to add some workarounds for compiling with the 3.12 version, since I don't really use fancy novelties of the language. I will keep this in mind, thanks. For now, maybe, try to update to 4.1, if it's available )


Update:
In fact, "view.ml" is one of the last modules, so if the first error occured there then, probably, the code is largerly 3.12-compatible. I can simply replace this function with my own analogous, this is a simple iterator, nothing special. I will let you know.

92
Early Dev / Re: Wanderers / open world RL
« on: February 25, 2014, 04:54:51 PM »
Hope to make a fun game ) Thanks for the responses!

How do you handle simultaneous actor movement? what if they decide to move to the same square, etc?

I wanted to make a time system, where decisions don't cause actions immediately, but take some time. There had to be a mechanism to resolve collisions and other possible conflicts. Well, eventually, I had to sacrifice some discreteness, making units' positions continuous. But it does not seem to be a very big deal, all steps are still discrete, you walk from square to square, because you don't get control over your unit until you cross the boundary between the squares (+ some delay).


Every unit has "position" (pair of reals) and its "location" (pair of integers), this is the square the unit is in. In the gif, the location is marked by four green dots. When walking, units move to the center of an adjacent square.

Every unit, when its move is computed, checks its current square + 8 adjacent squares. If there are other units, a force is applied to the current unit so that it's harder to move towards others. The force is non-linear (see "sim.ml", function "move_dv" (line 109), and "force_collision" (line 118)).

So, there is a simple physical simulation. Units are pushed when they collide, or when they are hit. Of course, one could use some rigid-body physics engines - but you don't need that, all collisions between units are "soft", so simple integration of the Newton's second law is really enough. It's easy. Even the time step does not have to be very small.

With some continuity of movement, you can make crowded city streets (need to add thieves there!), hordes of monsters pushing you, and not just waiting while you kill them one by one. Some physics in combat is also interesting. If you are heavy, you pushing opponents, if you are light and small, you can escape easier.


Looks really cool, and it's written in Ocaml!

I'm trying to compile it on Linux, but I get this error:
File "src/global.ml", line 18, characters 0-11:
Error: Unbound module Common


Any hints?

I don't know why this is happening. This is what my compiler outputs when I make the game: http://sprunge.us/QfZE
First, it finds dependencies between the modules with ocamldep, then it builds the GLCaml library, that it builds the game itself.

What is your system and the version of the compiler? Btw, I don't use Jane Street's Core, only the original standard library. The external dependencies must be minimal, only installed OpenGL and C headers, probably.

Paste the full output of the compiler, it should help to find the reason for this behavior.

93
Early Dev / Re: Wanderers / open world RL
« on: February 24, 2014, 05:22:26 PM »
Rickton:
There are two main mechanisms implemented:

1. "Bulk" simulation of the world.
Each small piece of the map (region) stores its population, how many units of each faction is there. Number of houses. Total wealth of the region.

The world is simulated by a few rather simple rules: there is population growth, unit transfer between neighboring regions, fights between enemy factions, if their people happen to be at the same region. Houses are built and destroyed. This is very rough and approximate simulation, but it is detailed enough to resemple civilizations growth and their wars with each other.

When the player is nearby, a region is genearaged from its seed, and units are spawned. If you kill anyone, that unit is subtracted from the region's population. In the background, this region is still simulated as a part of the big world even when the player is there, but latently, the changes are saved and applied when you leave the region.
When you walk far away from the region, the region is reconstructed together with all its units and items. All items are decomposed into wealth.

In this sense, the world is semi-persistent. About 10-12 regions around you are stored and simulated in detail, but they get decomposed when you explore new regions.

2. Heroes (or actors) are persistent units, essentially like the player, they travel and fight mobs. Any mob (except domestic animals like cows) can be such a hero.

When heroes are in a region generated for detailed simulation,  they is spawned together with other mobs, and they act like normal mobs, no difference there. However, when the player leaves, they are not decomposed entirely. They travel in the "bulk" world, fight with local units (their fights are approximately fake-simulated), they pick up items, choosing the best possible equipment they can find.



All of the above is already implemented. What I want to add are organizations of heroes (actors). They are going to be tree-like hierachies. Starting with simple local militia to fight neighbors and wild animals to governments and military forces. Actors-Merchants to sell stuff. Actors-Craftsmen, Blacksmiths, Engineers, etc. to make new high-quality items. Good to make some factions more inclined towards technology and dwarf-like traits.

The factions, btw, are random and generated with the world. In the biginning of each game, I plan to ask for the name of the world and the name of the player. Both will work as seeds. So, you can play in the same world as many times as you wish. And you can play the same character in different worlds. I think, it can be interesting to add the following feature: If your character dies, but the final goals are not achieved, you can continue playing with another character. It is not a simple respawn, b/c you start a new character, and you loose a lot of time. But if you was very close to kill the bad guy, your second character can finish the job, where the first failed.

P.S. I liked Game Hunter's video of your game Possession, never played myself, but it looked very interesting

94
Early Dev / Wanderers / open world RL
« on: February 24, 2014, 05:02:54 AM »



What is interesting about it?

1. The game is quite different from many Roguelikes and RPG games. First of all, the time system is semi-continuous: Your discrete actions are simulated in the continuous space and time, so you get interesting combat mechanics with a lot of pushing and dodging, while largely preserving the feel of familiar grid based games. 

2. The game world is simulated on two scales: The area around the player is simulated precisely with every detail taken into account, however, the rest of the world is not static and is evolving too with a bit coarser but still quite accurate simulation. Both simulation levels interact seamlessly, so your small actions will affect the whole big world. You can defend your village and make it stronger in the war with a neighboring tribe, or you can go explore the world and fight monsters in the underground dungeons.
 
3. Many features, for example social organizations of the NPCs, reputation, rumors, spell casting, villains, apocalyptic events and global quests are not implemented yet.


Can I play the game?

>>> Download for Windows:
Download the latest Windows build (January, 20, 2015).

How to play: README at Github.

>>> Download for Linux (and probably OSX):
Get the source code from Github. Compilation is straightforward. install the latest ocaml package for your system. Make sure you have your SDL1.2 and OpenGL libraries installed. Then just execute make.

How to play: README at Github

Controls

Arrow keys or h j k l - Movement
w a s d or Ctrl+direction - Melee attack
t - Rest
Space - Wait
i or Enter - Inventory mode (0, 1, 2 to move items between sections, Esc to cancel)
f - Ranged attack mode (f to shoot, Esc to cancel)
v - Interaction mode (v or Enter to open/close doors or barter, f for ranged attack)
m - Map (arrow keys and <, > to move, Esc to cancel)
< > - Use stairs
+ - - Faster or slower game speed
Esc or q - Cancel
Ctrl+q - Save and quit

Tips for new players

When you start playing, first, take a look at your CNS (Constitution). This is your mass in kilograms, and your max HP. Heavy characters are slower, and light characters are weaker. Also, light characters have better magical abilities.

The very first goal is to find some weapon, even a simple stick or a knife will make a big difference. You also may find a good random seed, where you start with weapons. To rest, press t, you will recover some HP. When equipping new items, pay attention to MBL (Mobility). When it drops down (say below 0.9), your damage also goes down considerably, and this is not what you want.


To get full Documentation about the game, read the README at Github.

The game is open source, distributed under GPL3 license.

Pages: 1 ... 5 6 [7]