Author Topic: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC  (Read 6025 times)

0 Members and 1 Guest are viewing this topic.

Offline DrazharLn

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #45 on: February 12, 2023, 09:36:14 AM »
Tiles in SMAC aren't very smooth, IMO. They're always formed of 4 triangles and you can often see the distortion in the texture if the heights of the corners are different enough.

Offline dino

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #46 on: February 12, 2023, 10:08:09 AM »
I think in the vanilla texture stretch happens only on the edge of the map and it's an issue with mapgen, that everywhere else avoids more than 1000m elevation difference, but it doesn't take into account that the edge of the map is treated as 0m elevation for rendering purpose. This vanilla issue could be either solved on mapgen level, or on rendering level by calculating the map edge elevation for rendering purpose based on neighbouring tiles elevation, but 0m elevation of the map edges assures bottom and top tile corners of the map edges being alligned in a straight line, so mapgen solution would look nicer.

But it's not what I was talking about at all. On the glsmac screenshots, the rendered surface of the tiles has just two triangles geometry, while in the original it has much more detailed geometry, where tiles borders are connected by tangent, not by angle, tops have convex surface, bottoms concave surface, etc. Yes, the square grid has simple geometry with straight lines connecting corners, but the rendered surface is smooth. Rendering smooth surface from a low resolution heightmap is something commonly done in games since early 90s, so it's not something autor would have to make himself probably, most likely there are free to use solutions available.

Hard to tell if it's the case in vanilla, but to potentially make it easier the smooth surface could be generated from the square grid corners and then the original square grid could be rendered on top of it, so the grid geometry wouldn't match precisely the visually rendered surface. Additionally sharp edges do exist on some landmarks geometry, like crater, or mesa, but I don't think they happen on geometry generated on regular tiles.

I understand it's only an eyecandy, but it'd be a shame if the map looked less nice in the remake, than in the original game.
« Last Edit: February 12, 2023, 12:20:06 PM by dino »

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #47 on: February 12, 2023, 12:37:45 PM »
Yes I'll add smoothing between tiles soon (after minimap probably).
There are many things that can be done to improve the look and I'm aware of them, I just want to get to game play first without spending too much time on eyecandy. Don't worry, when it's finished - it will look much better than original :) Maybe even better than last civ games.

Clickable command icons - yes, definetely enough space for them. Maybe I'll find some icons in SMAC's PCX too. Also, I can just put icons with capital letters (first letter of action), maybe this will work too. I need to add units first tho.


Offline dino

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #48 on: February 13, 2023, 12:11:39 AM »
> Don't worry, when it's finished - it will look much better than original :)
Doubt many people would care much beyond getting it close to the original, gameplay first indeed.

> Maybe even better than last civ games.
What do you mean, it always looked better than any civ game ;)

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #49 on: February 13, 2023, 05:23:05 AM »
> Maybe even better than last civ games.
What do you mean, it always looked better than any civ game ;)
Oh, I meant graphical fidelity like resolution of textures, lighting complexity, some cool visual effects, etc. Not art style of course  ;lol

Ok so I added some blending to rainy tiles to make edges smoother, I think it looks slightly better now. Maybe I should decrease it a bit, I'll experiment a bit in coming days.

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #50 on: February 13, 2023, 10:43:50 AM »
Ok this will do for now :) Moving to minimap.

Offline DrazharLn

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #51 on: February 13, 2023, 02:47:54 PM »
Here are some examples showing some texture stretch in original SMAC and how each tile was drawn with 4 triangles: each tile has five vertices, it's corners and its center. You can see this most clearly in the second image below.

When you're zoomed out, I think these distortions make the game look better because the terrain appears more varied with fewer visibly repeating textures (last image, the two tiles pointed to by arrows use the same terrain sprite, but the large distortion on the one on the left means that they look visually distinct).

When the textures end up quite misaligned then it can look a little strange (first pic), but I don't know if it's worth doing anything about that.

For a remake, it might be neat to try some full colour textures with normal (bump) mapping and maybe roughness, but I think it would take quite a lot of work to make something that looks good and also fits in with the other graphics.

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #52 on: February 13, 2023, 05:39:55 PM »
 ;b; I see. I'll experiment with it after minimap, it's actually quite easy to stretch textures in OpenGL, center vertex can also be moved a bit in different directions if needed (should be done carefully though to not disrupt geometry too much).
Bump mapping is a bit more time consuming, so better postpone it.

Offline dino

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #53 on: February 13, 2023, 07:10:43 PM »
@DrazharLn It looks like you were right, there is four triangles geometry for each tile, but the shading makes it somehow look smooth and unnoticeable when zoomed out due to high resolution.

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #54 on: February 14, 2023, 12:58:17 AM »
Added random texture stretching and random center vertex offsets, it looks better but sometimes has these abrupt texture ends, I don't know if I have time to fix them now.
Looks like coastlines is the main thing holding everything back, I'll try to finish them this week.
About tile preview - you can see it's square topdown, it's experimental thing, there are some reasons why I think it will be better:
1) SMAC was designed for very tight resolutions like 800x600 so they made tile preview shorter to give space for unit list. At modern resolutions unit list is huge already, so there's no point. Also UI looks more symmetrical now.
2) In SMAC tile preview frame was too small and could not fit all lines if there was much terraforming on tile. Now it can fit everything (tile image will shrink as needed to fit all text lines below, it's only big when there's enough space). At same time, most tiles won't have many lines so keeping tile image small would create too much empty space, not looking good
3) At modern resolution default SMAC tile image size can be too small to look at. Also when I tried it it got too blurry (because it was topdown tile that was skewed by vertical axis, hence losing quality). Original top-down view displays tile at original scale, so it keeps all detail. It actually gives more visual information about tile than player may see on map (because there it's under ~45 degrees angle).
4) Currently there is no way to display actual 3D tile in UI, so the only way is taking topdown texture and warping it, it makes it look blurry and inaccurate (because it really is topdown). Also it makes it look like tile is flat, while in reality it isn't. Once 3D-inside-UI functionality is implemented (probably somewhere around base management UI time) I'll try orthographic 3D view of tile there, along with it's elevations, then maybe it will look good.

I tested different map sizes today, so far maps up to 200x120 tiles work already, maps up to 1000x1000 'almost work' (they are generated, shape works but terrain texture doesn't so it's just black screen where I can click and select tiles and they appear in preview with text lines), I'll need to split terrain texture into several and then 1000x1000 should be possible with maybe ~100 FPS. I got ~300 FPS at 640x480 map (it's like 16x larger than 'huge' in SMAC, or 32x?), FPS improves once you zoom in so if zoomout level will be limited then maybe even larger maps will be possible (next bottleneck will be available RAM).

p.s. Lore question - Alpha Centauri is triple star system, right? Won't it make sense to add 3 directional lights then instead of 1? It will also remove those weird straight lines appearing because of shadows, also I can make lights of slightly different color (and later maybe slowly rotate around map or even day-night cycle).
« Last Edit: February 14, 2023, 01:28:25 AM by afwbkbc »

Online Buster's Uncle

  • In Buster's Orbit, I
  • Ascend
  • *
  • Posts: 49271
  • €440
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #55 on: February 14, 2023, 02:04:50 AM »
It's closer to a binary w/ a distant companion - Proxima is small, and ISTR 1/3rd of a light year out.  Two lights would fit the lore...

Offline dino

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #56 on: February 14, 2023, 04:17:55 PM »
I have a new theory on how the smooth map look is done in the original.

I think the shadowmap is blurred, so the sharp angles of geometry are not visible as steep differences in shading and it creates an illusion that geometry is smoother than it is.
« Last Edit: February 14, 2023, 09:46:41 PM by dino »

Online Buster's Uncle

  • In Buster's Orbit, I
  • Ascend
  • *
  • Posts: 49271
  • €440
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #57 on: February 14, 2023, 05:26:39 PM »
As a game-art artist, that scans for me...

Offline DrazharLn

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #58 on: February 14, 2023, 11:39:31 PM »
Not that I think it matters to make the terrain look great right now, but here's a screenshot of what I think is some nice shading in SMAC. The shadows looks like they're quite diffuse, it also helps that SMAC is doing some climate modeling so the rainy areas are in consistent places, which is giving some nice visual variation in the same kind of places as the shadows.

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #59 on: February 15, 2023, 12:44:15 AM »
There are many things that can be done, but let's not forget that original SMAC was in development for 3 years (4 with expansion) by a team of people that also had experience in developing civilization and maybe also had some usable code and parts of engine when they started.
So I have no choice but to 'cut corners' sometimes. That means that I will only add visual improvements in two cases: 1) if it looks absolutely terrible without it (such as coastlines now, still not finished) 2) if it takes low effort to add them.
For now my goal is to quickly make all core functions so that others could join in development (including developing visual improvements).
So patience, please  :)

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

When beholding the tranquil beauty and brilliancy of the ocean's skin, one forgets the tiger heart that pants beneath it; and would not willingly remember that this velvet paw but conceals a remorseless fang.
~Herman Melville, ‘Moby Dick’, Datalinks

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 38.

[Show Queries]