aliens

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 - Nikita_Sadkov

Pages: 1 ... 11 12 [13] 14 15 ... 20
181
Resources / Re: Graphic Gallery
« on: May 09, 2019, 12:00:24 am »
I think I can safely speak also for all other OXC and OXCE devs when I say that this is the absolute bottom of our priorities.
What about converting graphics to simpler formats, like those in Wesnoth? That would promote modding. Say on the first run OXC could dump all data to PNG, WAV and CSV, and then uses these files. Now modding would be as easy as opening CSV in a spreadsheet app. That way supporting HD-graphics would be a matter of adding support to blitting routine.

182
Would be cool to have The Thing like aliens. Which could randomly infect/replace player's soldiers or civilians, and then hatch at some random moment, when player least expects it. There could be kits to test for infection/replacement, and robotic soldiers immune to it, etc... But guess it will require modding the engine.

183
Resources / Re: Graphic Gallery
« on: May 05, 2019, 11:31:34 am »
Ok, used some sprites from adjacent topic, i have done these terrains:
Cool! But I think it would be nicer, if OXC could handler larger sprites, instead of downscaling them. Most people have more than 320x240 pixels on screen. And most original art could use some retouch for higher resolution too. That should be a priority of OXC devs ;)

184
Offtopic / Re: Does anyone not from Thailand pls come in
« on: May 03, 2019, 12:54:56 am »
Most countries have elites rigging their elections one way or another, manipulating electorate. But some countries, like North Korea, just do it in blatant manner, and then tax population for 100%, without hiding it, and if someone complains he gets executed. That is like slavery.

185
Offtopic / Re: XCOM Inspired Fantasy Game
« on: April 28, 2019, 03:54:05 pm »
wow, looking good.
Unfortunatelly it is a bit tricky to generate rivers. One may suggest a simple gradient descent, but then rivers will end at a local minima. So it requires waterflow and erosion simulation to get out of local minima, without flooding like half of the island into a swamp. It is easier with the graph methods, where one can just send waterflow along the edges.


186
Offtopic / Re: XCOM Inspired Fantasy Game
« on: April 28, 2019, 12:38:44 am »
Slowly it comes to something usable in the game. Tilesets taken from Freeciv  :P

187
Offtopic / Re: XCOM Inspired Fantasy Game
« on: April 25, 2019, 09:26:09 pm »
If I pick it up again, I'd probably need to add some functions after the initial polygon generation to randomize the coastlines a bit, since they tend to bear the hallmark of the great circle lines, making them look boring and obviously computer-generated.
I doubt there are any better algorithm than the midpoint displacement, which is very robust, corresponds to real life islands and can fill-in very precise shapes with arbitrary constraints.

People also use it to generate electricity or lightning like effects. And it also can serve as an input for sound generation, if you need some beefy synthetic sound  effects for your sci-fi setting video or game https://soundcloud.com/nikita_sadkov/explosion

I.e. the algorithm is a goldmine of cheap content, when you have no money to pay artists or sound designers.



Although I've found that the midpoint algorithm on a square grid has apparent bias, because it needs to sample from all 8 nearby cells, but the distance to four cells is 1, while distance to the four other cells is sqrt(2), meaning that N,S,W,E directions have less influence that they should, so the result isn't perfectly random and has predictable patterns, like say 45 degree lines are 1.4 times more likely than 90-degree ones. I.e. again we have that nasty square situation :D Googling has shown that people fix this sampling bug using some advanced math, beyond my grasp. But I'm sure it can be fixed by using hexagon grid instead, and then sampling down to squares. Still for my purposes these subtle errors ain't that noticeable and diagonal walls look more gamey.

Anyway, here is the current state of island generation. Several of these islands will be merged together to create game world.




188
Offtopic / Re: XCOM Inspired Fantasy Game
« on: April 24, 2019, 03:31:44 pm »
Solved the concave polygon render with multi-pass raster scan, without any flood fill queue. Comes out nicely with a tail of islands on demand. Mirroring it would produce figures for a new Rorschach test :D

The shapes are still triangle based, but I can also fed in a rectangle or a hexagon or any polygon.

It is also useful to rotate these brushes, so had to invent the algorithm to rotate a point P around the origin O:

Code: [Select]
rotate A O P =
| Dir = P-O
| DX,DY = Dir
| CosA = A.cos
| SinA = A.sin
| NX = DX*CosA - DY*SinA
| NY = DY*CosA + DX*SinA
| [NX NY]+O

The hardest part is noticing that you don't need to compute the length of P-O, because division by it gets cancelled anyway.


189
Offtopic / Re: XCOM Inspired Fantasy Game
« on: April 23, 2019, 07:14:52 pm »
Decided to use midpoint displacement. It is trivial to implement, and orders of magnitude easier to control, compared to say perlin noise, voronoi or random walk. Although one can surely tweak random walk to produce something similar to midpoint displacement. In the end, all these methods are closely related.

Also, naive perlin noise generator producing circular(!) rivers:
https://mccormick.cx/news/entries/blog-post-game-code-dabbling

But yeah, some people love crazy abstract stuff. Many fans very unhappy when Minecraft's map generation got tuned down to be less extravagant, killing stuff like overhanging terrain.


190
Offtopic / Re: XCOM Inspired Fantasy Game
« on: April 21, 2019, 05:20:08 pm »
A reverse engineered explanation of the original Civilization map generation algorithm:
https://forums.civfanatics.com/threads/civ1-map-generation-explained.498630/

basically, Civ1 accumulated several random-walks, and then fixed the resulting map so unit wont be moving across what appears impassable body of water.

I've used similar code in my ancient Warcraft II map generator: https://github.com/saniv/wc2gen/blob/master/src/wc2gen.c

But instead of random walk patches, I've just put several seeds, and then applied cellular automation to the whole map, first for landmasses, then for hills, and then for forests. After that trying to place resources and player bases.

Mapgen4 also uses same tactics with placing emitters, but then builds voronoi polygonal surface, instead of running cell automata or random walk.

Alternatives: fractal generation, with midpoint displacement; overlaying some noise functions (like Minecraft does with perlin noise); and XCOM and Spelunky style of combining premade map pieces (Minecraft also embeds premade pieces inside noses-function generated map).

Instead of voronoi, one can probably uses other methods to interpolate inside point cloud, like quadtrees or metacircles: https://dribbble.com/shots/1776495-Metacircle-effect-source-file

191
Offtopic / Re: XCOM Inspired Fantasy Game
« on: April 21, 2019, 01:15:23 pm »
Digging out procedural map generation. The following appears to be the state of art:
https://github.com/redblobgames/mapgen4

192
Offtopic / Re: XCOM Inspired Fantasy Game
« on: April 21, 2019, 03:08:18 am »
One solution would be not use hex but triangles, if they are arranged in hex then you keep all hex good properties but you still can have orthogonal moment.
Trick is that 1TU allow you to move thought 2 triangles. I added small graphic that show this, All red dots are valid unit positions, black lines are allowed "half" moves. Effective this is multiple hex grids overleaped on each other.
Yeah. That could work. And you can still reuse the same hex tileset.

193
Offtopic / Re: XCOM Inspired Fantasy Game
« on: April 19, 2019, 09:49:51 pm »
I gotta say though, I hate hexes with a passion. The reason is simple: you can go in a straight horizontal line, but not vertical (or vice versa). This feels pretty shitty.
That can be remedied a bit by moving units vertically, when that is possible (i.e. there are no blocking units or triggers in the way), but only visually, behind the scenes units would still move on the lattice. In case of RTS, that will require more hacking obviously. Of course wargames, like Panzer General, move units directly in straight line right to their destination.

194
Offtopic / Re: XCOM Inspired Fantasy Game
« on: April 19, 2019, 03:28:02 pm »
With a game world split into discrete cells, especially large ones, there is another tricky design moment: picking hexes or squares. Squares are a bit easier to implement, yet naturally allow movement into only 4 directions. That is - squares create space with non-Euclidean topology and use Manhattan distance as a metric. Of course, trying to remedy that, you can also allow diagonal movement, opening a can of worms on its own, because units now move diagonally faster than they do horizontally. Surprise!

You can try solving that by further replacing the discrete number of action points with say a floating point number, subtracting 1.41421356237 for each diagonal move, instead of 1, but sqrt(2) is an irrational number, so there will always be some bias, unacceptable for a competitive turn-based strategy. Even worse, if you have two walls, sharing a corner, then a unit could still stick through it, even if it looks impassable.



Diagonal movement is clearly bolted on, but moving in just 4 directions would be too inaccurate and limiting for an strategy game, and that is why people prefer hexes to squares.

Yet with picking hexes, we have to make another important design decision: hex lattice can be rotated differently on screen. For example, Heroes of Might & Magic uses grid with vertically shared edges, while Battle for Wesnoth uses horizontally shared edge.

The case of vertical sharing allows for wide-screen friendly viewport, when each player has its own side of field, and units move without zig-zaging. Battle for Wesnoth maps on the other hand tend to placing two opponents at the north and south, because movement east and west will go in zig-zag.

Heroes of Might & Magic style grid also cheapens graphics production. In Wesnoth they have to draw units both facing south and north, while HOMM unit's sprite can be simply mirrored. That is in addition to nicer looking diagonal walls on castle siege maps. That saves both artist's time and and video memory.

Another decision is how to lay out hexes in a map. Obvious decision is to lay them in a square grid. Yet it would be a very bad idea to organize hexes as a square. A round world would be orders of magnitude better, as it allows easily making well balanced symmetric maps for any number of players, instead of just 4 corners or 4 edges of square grid. Round maps are important, because in hexagonal world area of effect and just larger structures too have hexagonal form. That is in addition to simplifying programming (it is a tricky task to pack hexes into a box).

That what they call good design - not fighting mathematics, but go along with it.

TLDR: my biggest mistake was picking squares over hexes. I would recommended hexagonal lattice even for real-time strategies. Unfortunately Blizzard doesn't feel enough competition to fix their competitive games and make the next Stracraft into a perfect game.




195
Offtopic / Re: XCOM Inspired Fantasy Game
« on: April 17, 2019, 11:09:20 pm »
globe is not 3d object, its drawn using 2d polygons, all 3d math is done on our side. Normals are only avaialbe because we know that globe is sphere, with this I can precalculate them for each pixel of screen and zoom level.
Reminds me of Ecstatica, but they actually preserved all 3d geometry from the raytrace stage to properly occlude everything:
http://dingevoninteresse.de/wpblog/?cat=12

During the raytracing stage they also used really interesting texturing method by filling rocks with randomly placed sharp boxes, and organic objects with ellipsoids, instead of modelling then in a 3d editor. They had no 3ds Max or Maya back then, or large memory sizes to push that many polygons even for offline rendering. That gave the game its immediately recognizable clean art style.


Pages: 1 ... 11 12 [13] 14 15 ... 20