All Projects → Hachitus → FlaTWorld

Hachitus / FlaTWorld

Licence: MIT license
2D strategy game engine for browsers

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to FlaTWorld

Openra
Open Source real-time strategy game engine for early Westwood games such as Command & Conquer: Red Alert written in C# using SDL and OpenGL. Runs on Windows, Linux, *BSD and Mac OS X.
Stars: ✭ 10,220 (+56677.78%)
Mutual labels:  engine, strategy-game-engine
UE4-BYGLocalization
Simple CSV localization system for Unreal Engine 4
Stars: ✭ 54 (+200%)
Mutual labels:  engine
unocss
The instant on-demand atomic CSS engine.
Stars: ✭ 7,866 (+43600%)
Mutual labels:  engine
pixie
Tiny template functions.
Stars: ✭ 14 (-22.22%)
Mutual labels:  engine
pixi-miniprogram
一个可运行于微信小程序的PIXI引擎,通过模拟window环境,有些功能小程序无法模拟,就直接修改了PIXI引擎代码,最终使得PIXI引擎正常运行在小程序上
Stars: ✭ 72 (+300%)
Mutual labels:  engine
Fractal Engine
WIP 3D game engine with editor and other stuff
Stars: ✭ 152 (+744.44%)
Mutual labels:  engine
Video-Engine-Dash
A Dash plugin for playing back video and optionally syncing video to timestamped CSV Data
Stars: ✭ 26 (+44.44%)
Mutual labels:  engine
Mage-Studio
Mage Studio is a Game Editor, built on top of Mage Engine, embedded in Electron. Mage Studio will allow to easily develop 3D apps using WebGL.
Stars: ✭ 16 (-11.11%)
Mutual labels:  engine
Awesome Unreal Engine 4
UE4/UE5 Ressources Collection (Plugins, Effects, Doc, Tools, etc...)
Stars: ✭ 153 (+750%)
Mutual labels:  engine
DuEngine
An efficient interactive C++ renderer for ShaderToy-alike demos with 2D/3D/CubeMap/Video/Camera/LightField/Volume textures. (Partially used in my I3D 2018 papers)
Stars: ✭ 62 (+244.44%)
Mutual labels:  engine
naas
⚙️ Schedule notebooks, run them like APIs, expose securely your assets: Jupyter as a viable ⚡️ Production environment
Stars: ✭ 219 (+1116.67%)
Mutual labels:  engine
Squirrel-Engine
Multithreaded C/C++ Game Engine
Stars: ✭ 90 (+400%)
Mutual labels:  engine
wgpu-mc
Rust-based replacement for the default Minecraft renderer
Stars: ✭ 254 (+1311.11%)
Mutual labels:  engine
sdl2-raycast
SDL2 C++ raycasting engine with vertical movement, floor/ceiling texture mapping and sprites.
Stars: ✭ 80 (+344.44%)
Mutual labels:  engine
New-Star
Web. browser game engine :)
Stars: ✭ 64 (+255.56%)
Mutual labels:  engine
DummyEngine
Small cross platform Vulkan/OpenGL 3d engine for personal experimentation
Stars: ✭ 76 (+322.22%)
Mutual labels:  engine
shtm
No description or website provided.
Stars: ✭ 21 (+16.67%)
Mutual labels:  engine
Purity
Wiki authoring engine.
Stars: ✭ 41 (+127.78%)
Mutual labels:  engine
audit-log
📑 Create audit logs into the database for user behaviors, including a web UI to query logs.
Stars: ✭ 135 (+650%)
Mutual labels:  engine
magento-gae
Magento Google App Engine Compatibility
Stars: ✭ 19 (+5.56%)
Mutual labels:  engine

GPLv3 Affero License Gitter

Development halted

Unfortunately for several (personal) reasons, I've decided to cancel the development of the engine. There was a game in an ok status being developed with it, so with small performance and bug tweaks then engine was in quite a good shape already. But there is a time for everything.

ALPHA!

The development is still in alpha stage. Basic features are mostly done for the engine, but the API and structure can still go under changes, please take that into account! Also please contact me if you plan to use the engine or have questions! Gitter is an easy option too.

Introduction

2D turn-based strategy game engine for browsers. The engine originally got into development to get an engine for more hard-core turn-based games and not casual games. I was frustrated at waiting for those games and decided to start making it on my own. Browser environment is a perfect match for turn-based multiplayer. You can continue your turn easily anywhere, any time!

If you are interested contact me (http://hyytia.level7.fi/). I am eager and grateful to get any feedback or help with the project.

Table of contents

Hot links

Developing

Installation

npm i flatworld

Examples

Best example is found in plunkr. This is the base map created with the engine. The latest example will be found from the engines manual tests (in src/tests/-folder). A working example should also be found in: http://flatworld.level7.fi/manualStressTest.html, but not quaranteed that it is always on (as server can be down or dns changed).

Setup a simple map

The main module for the whole map is core.Flatworld, so you should always primarily look through it's API and then dig deeper. The best examples for setting up a map at the moment is still going through the code. Check the test-files: tests/manualTest.html and tests/manualStressTest.html (which are more comprehensive). They use horizontalHexaFactory to go through the map data and setup objects based on that data. You can use horizontalHexaFactory if you want or setup your own factory and own data structure. Factories always have to follow a certain data structure so they might not be something everyone wants or can cope with.

Simple example:

import Loader from 'resource-loader';
import { ObjectTerrain, ObjectUnit } from "/components/map/extensions/hexagons/Objects";

const baseUrl = '';
preload = new Loader( baseUrl, { crossOrigin: false } );
preload.add( "terrainBase.json" );

preload.load(() => {
	var map, thisLayer, newObject;
	var layerOptions = {
    	name: "terrainLayer",
      	drawOutsideViewport: {
        	x: 100,
        	y: 100
      	},
      	selectable: layerData.name === "unitLayer" ? true : false
    };
    var objData = {
      typeData: "typeData,
      activeData: "someData"
    };
    var currentFrame = 1;
    var hexagonRadius = 50;
    var objectOptions = {
        currentFrame,
    	radius: hexagonRadius
    };

	map = new Map(canvasElement, mapOptions );
	dialog_selection = document.getElementById("selectionDialog");
    defaultUI = new UI_default(dialog_selection, map);

    /* Initialize UI as singleton */
    UI(defaultUI, map);

	map.init( pluginsToActivate, startPoint );

	thisLayer = map.addLayer('terrain', layerOptions);
	newObject = new ObjectTerrain({ x: 1, y: 1 }, objData, objectOptions);
	thisLayer.addChild(newObject);
})

Factories

Factories are the ones that get the server-side data, iterate through it and create the necessary objects to the FlaTWorld map.

You most likely need to implement your own factory function for your game, if the game is not very close to the factory that the engine provides. At the moment I suggest you read through the code in hexaFactory.js and create your own based on that.

Extensions

The map supports adding extensions and even some of the core libraries parts have been implemented as extensions. You must comply to few rules:

  • Be careful when constructing an extension. They have a lot of freedom to mess around with the map data (which might change in the future).
  • When extension is initialized, it will create this.mapInstance and this.protectedProperties. First has the current instantiated map and second the private methods and properties for plugins to use
  • Extensions init-method must return promise, to verify, when the plugin is ready
  • All parameters extensions can receive are functions, that are bound in plugin context
  • Must return an object containing:
    • init-method
    • 'PluginName' variable, which has same value as the exported library name

You can see the required format from e.g. hexagon extension.

The format for these rules as an example:

	export const sameNameThatIsExported = setupModuleFunction();

	function setupModuleFunction() {
    return {
  	  pluginName: "sameNameThatIsExported",
  	  init: function(map) {}
    }
	}

Templates

All UIThemes should extend the UIParent module and they have to implement methods listed in UIs private function validateUITheme.

You have to initialize the UI by calling UIInit method in flatworld.

Events

For events involved with the FlaTWorld map, you should check the current list from the mapEvents.js file. We try to keep it as up-to-date as possible.

Requirements and efficiency goals

Supported environments

  • Desktop: Edge, Chrome, Firefox, Safari
  • Mobile: Devices not listed, but basically anything that has browser, with these restrictions:

Aimed mapsize and efficiency

These are still subject to change (both raised and lowered). The map is planned to be big! In the way that I checked pretty much the biggest civilization community made maps and got over it. Since those maps do not seem to be sufficient for the plans I have for the engine! But these are still very realistic goals with the present setup.

  • Maximum map size: 225 000 000 pixels (15k * 15k)
  • Total object count on map: ~50k
  • FPS in mobile min. 30. No FPS goal set for desktop as mobile defines the limits.

Credits

Testing:

  • Thank you to browserstack for providing magnificient testing tools browserstack logo

Graphics:

Sounds:

Contributors:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].