Hello everyone, I want to write a stardew valley type farming game called "conflict zone farmer".
The idea is it will be a farming game, quite similar to stardew valley. The tone of the game however will be very different from stardew valley. Whereas stardew valley is quite cutesy with a "feel good" aesthetic, I want my game to have a gritty tone to it.
The game will be set in the early-mid 2000s and be set in afghanistan. The main character will be a westerner who has recieved a letter from his grandad (as in stardew valley), saying that they need to go to afghanistan and look after the family farm.
In the game you can either side with the taliban or with the coalition troops. Siding with either one brings benefits but the safest thing to do is to not side with either.
Like stardew valley the game will feature combat mechanics, but unlike stardew valley combat will be exclusively for defending your farm from attackers.
The game will feature a permadeath mechanic and people living in the village may be randomly be killed by fighting between the two opposing forces. If you keep playing long enough, you'll be the last one left.
The idea is the game will take the subject matter seriously and try and be balanced, and drive home how horrible war is, as well as being a more challenging stardew valley.
It will have a 16 bit 2D art style much like stardew valley.
I've started writing the engine (in C not C++) for it already, beginning with an in-game ui system and "Game layer" system similar to the one described in "Game Programming Gems". The UI is a retained mode UI where the UI layout is defined in xml.
In the same repo as the current engine (up a folder or two) is a method of rendering tile maps in OpenGL which I intend to use for this game.
My idea for the game engine is to extensively use lua scripting for as much of the gameplay related code as possible. I will NOT make an editor for it, as I've found that this is a massive time drain. Instead I'll use an existing 2d game editor like "tiled".
Still very early days yet but I hope to write updates on this site.
So far I've found it very refreshing to be using C and not C++. I couldn't put into words why, perhaps it is just the novelty of it, or perhaps it is simply the lack of object oriented language features forcing me to think somewhat differently about the design of my code. One thing that is definitely more of a pain in the arse is string manipulation. C libraries for xml and json parsing are defintely less ergonomic to use than some C++ ones I've used in the past.
todo list:
add text rendering
add text UI widget
add button UI widget
add tick box UI widget
add grid UI widget
add radio button ui widget
add scroll panel ui widget (maybe)
add tab panel ui widget
text edit ui widget
different sprite for cursor
implement lua scripting and input listening into ui
implement game layer
https://github.com/JimMarshall35/TileMapRendererExperiments/tree/master/Engine
Here's another 2D game engine I made years ago and abandoned. The end result will look similar to this! I've learnt a lot since this and figured out much better ways of doing things.
The design of this one is pretty similar. It used lua very extensively and did not have an editor. This one created a single texture for each background layer, blitting tiles to one texture to create a single image. The new one will have the tile indices in an integer texture, and each frame will create a "grid" mesh that covers only the visible portion of screen, reading which tiles to render in the grid from the tile indices texture. This will be a much better approach as the game will require the player to be able to alter the tile maps at runtime as they dig holes, and plant crops ect. See the folder "TileMapRendererExperiments" for an example of how I'll implement this.
In short I hope to implement a tilemap rendering pipeline with a vertex shader similar to this one (no vertexes are passed to it, it creates them based solely on count passed to glDrawArrays (or whatever the function to draw it may actually be):
#version 440 core layout (location = 0) in vec2 pos; layout (location = 1) in vec2 uv; out vec3 TexCoords; uniform mat4 vpMatrix; uniform mat4 modelMatrix; uniform ivec2 chunkOffset; uniform ivec2 chunkSize; uniform usampler2D masterTileTexture; #define TILE_NUM_VERTS 4 #define NUM_TILE_INDICES 6 void main() { // vertices and indices that make up two triangles (a quad) // ie one tile in the map vec4 vertices[TILE_NUM_VERTS] = vec4[TILE_NUM_VERTS]( vec4(0.5f, 0.5f, 1.0f, 1.0f), vec4(0.5f, -0.5f, 1.0f, 0.0f), vec4(-0.5f, -0.5f, 0.0f, 0.0f), vec4(-0.5f, 0.5f, 0.0f, 1.0f) ); int indices[NUM_TILE_INDICES] = int[NUM_TILE_INDICES]( 0, 1, 3, // first triangle 1, 2, 3 // second triangle ); // cycle through indicies int index = indices[int(gl_VertexID % NUM_TILE_INDICES)]; // get base vertex vec4 baseVertex = vertices[index]; // which tile in the map is being drawn? int whichTile = gl_VertexID / NUM_TILE_INDICES; // transfrom into x y coords of tile in the chunk ivec2 tilexy = ivec2(int(whichTile / chunkSize.y), int(whichTile % chunkSize.y)); // translate base vertex by tilexy baseVertex.xy += vec2(tilexy); // set the z coord of the tex coords passed based on what tile is here // in the master tile map. TexCoords = vec3( baseVertex.zw, float(texelFetch(masterTileTexture, tilexy + chunkOffset, 0).r)); gl_Position = vpMatrix * modelMatrix * vec4(baseVertex.xy, 0.0, 1.0); }