Vangers icon indicating copy to clipboard operation
Vangers copied to clipboard

Vangers Enhanced

Open lpenguin opened this issue 8 years ago • 15 comments

Hi, guys! Thanks for sharing Vangers source code, it's really a gift.

I wonder, may be it's time to make "Enhanced" version, like Black Mesa. With 3D graphics, sane physics and so on. I dumped a peace of Forstral level and loaded it into Unity3D. There is a trouble with rendering of "floating" in air objects (like wires), but even now it looks pretty cool for me: https://youtu.be/-4nQo-NwsLM. I think such project is a LOT of work, but may be it's worth it?

lpenguin avatar Jul 28 '16 13:07 lpenguin

  1. You can help this project https://github.com/kvark/vange-rs
  2. You are not correct parse second level.
  3. Good idea :)

stalkerg avatar Jul 28 '16 14:07 stalkerg

You can help this project https://github.com/kvark/vange-rs

thank you, i'll try to cooperate =)

You are not correct parse second level.

Well.. actually i'm not parsing levels, i just dumped data from lineT[i] variable inside accept() function. See code. Then i loaded data into python, and saw strange picture: pic

This vertical stripes showing top level (odd indexes: 1, 3, 5,...) and lower level (even indexes: 2,4,6,..), i thought. So i just averaged odd and even stripes, and got two images:

Top level: Right part of level on my video (click)

heven

Lower level: Left part of level on my video (click)

huneven

I know, averaging is not good, but it was enough for short demo.

How to correctly parse vertical "stripes"/second level? I cannot find such peace of code, but honestly I did not spend with Vangers code much time...

Good idea :)

Thanks! I have some experience with C++, Shaders(HLSL) and Unity3D, and have some free of work time for such project. This is one of best games of my youth, and it would be really cool to present it to current generation :) May be we could add support of modern screen resolutions, make new menus (like what happened with Baldurs Gate), or even build new engine with 3d support.


Я извиняюсь за английский, просто хочется чтобы поучаствовали и англо говорящие тоже :)

lpenguin avatar Jul 28 '16 19:07 lpenguin

https://github.com/KranX/Vangers/blob/master/src/terra/siderend.cpp#L63 For detect second level and low res after that (second level merge into first level as tile).

stalkerg avatar Jul 29 '16 11:07 stalkerg

https://github.com/kvark/vange-rs/blob/master/src/level/mod.rs#L75 you can see here too.

stalkerg avatar Jul 29 '16 11:07 stalkerg

Ok, thanks!

lpenguin avatar Jul 29 '16 11:07 lpenguin

Hi guys, i am trying to run vangers in different resolution (other than 800x600). Thanks to @vaelund i could change resolution via command line args. I faced few issues:

  • Image distortions (like here: https://github.com/KranX/Vangers/issues/58#issuecomment-41490721) This happens because of this peace of code https://github.com/KranX/Vangers/blob/f1f63c47bb5069c6c79d0b100dfe9996a35dd9e1/src/actint/actint.cpp#L3255
curIbs -> back -> load2mem(XGR_VIDEOBUF);

Video memory buffer size does not match image size. We could just use offs_show(int x,int y,int frame = 0); function instead

  • We need to move menus, buttons, panels etc somehow. I think the easiest way is to edit game resources: is there some any way to do it?

lpenguin avatar Sep 22 '16 13:09 lpenguin

Thanks to @vaelund i could change resolution via command line args. I faced few issues:

I am still working on that. I haven't even found the code that draws the UI elements. I would appreciate it, if you could point me in the general direction. I do not think that editing the ressources is the right way to go, scaling and/or repositioning seems easier and would work for almost al screen sizes.

vaelund avatar Sep 27 '16 17:09 vaelund

I do not think that editing the ressources is the right way to go, scaling and/or repositioning seems easier and would work for almost al screen sizes.

Well, yes and no: i agree that we don't need to edit resources for every possible screen resolution. But i think it would be easer to edit few values than to find and edit UI code if we want to run simple working prototype (for single resolution). Moreover, we will need resource editor for images editing, elements alignment (to which side of screen elements should stick), etc. May be i'm a maniac, but I made bunch of scripts for converting xbm/bmp to png, and for converting binary resources to human readable format and vice versa. I'll share this a little bit later.

I am still working on that. I haven't even found the code that draws the UI elements. I would appreciate it, if you could point me in the general direction.

I am happy to help you: Main UI rendering happens in actIntDispatcher::redraw() function, just after the surface rendering (see iGameMap::draw()). This function followed by aScrDisp -> flush() call, but as far as i understand flush() does almost nothing (only i_evince_pal(actIntPal,16); does some useful work).

As far as i understand game UI consist of:

  • fncMenu - two menus on right side of screen (map, compass, etc)
  • aButton - buttons (open hatch, open inventory)
  • invMatrix - inventory UI (i didn't dig into this so far)
  • CounterPanel - race counters
  • InfoPanel - top right panel with time (may be hull, spiral indicators also?)

There is also some static images:

  • background
    image host
  • frame:
    image host
  • fncMenus also have their own backgrounds

Vangers code is not easy to understand, and i am very glad i'm not alone in this journey 😄

lpenguin avatar Sep 27 '16 18:09 lpenguin

Thanks, that is very helpful.

I already fumbled around inside iGameMap::draw() to get the map to be drawn at full screen size. Time constraints prevented me from getting much further.

if we want to run simple working prototype (for single resolution).

Well for that we would not need to put in any work. I get nostalgic for 800x600 anyway^^

I actually started working on this to get a grip on the codebase and clean it up at the same time(or at least try)

Maybe tomorrow evening i can push a fix with properly scaled 3d objects, afterwards i will look into the ui.

[Offtopic:]

Vangers code is not easy to understand

That definitely isn't limited to Vangers. It seems to be a constant for games, that the developers have bad coding habits or more likely too short deadlines. But at least you can clearly see the places were the more recent development, to port this to SDL happened.

i am very glad i'm not alone in this journey :smile:

Same here, might motivate me to work a bit more on this.

vaelund avatar Sep 27 '16 20:09 vaelund

Maybe tomorrow evening i can push a fix with properly scaled 3d objects, afterwards i will look into the ui.

How exactly do you want to support high resolutions? Just move UI elements to screen corners or scale (2x, 4x) them? I don't quite understand why you scale 3d, looking forward to your fix :)

lpenguin avatar Sep 29 '16 15:09 lpenguin

Here is aci_hi.scb file exported to yaml: https://gist.github.com/lpenguin/43165fbca9b9452e58d08804dde11cf6

As far i understand it contains information about UI, world constants, mechoses, may be more.. File is pretty big, i suggest opening it in Sublime Text (it has nice yaml support with object folding).

i used ParseScript function (iscript.cpp) as a base and made script in python (https://github.com/lpenguin/vangers-utils) that dumps every value or operation code. Keys starting with "$" is just comments.

lpenguin avatar Sep 29 '16 15:09 lpenguin

Решил поделиться, что смог сделать по-поводу больших разрешений:

  • Удалось убрать шум когда переключаешься в фулскрин
  • Менюшки прилеплены к правому, а не к левому краю экрана (не важно какое разрешение)
  • Уровень отрисовывается во всю ширину/высоту, поверх него отрисовываются менюшки
  • Камера сдвинута не к центру отрисовываемой области, а чуть левее, чтобы не мешали менюшки: лучше посмотреть на скрины

Наработки в ветке https://github.com/lpenguin/Vangers/tree/fullscreen Запускать:

./vangers --screenwidth 1200 --screenheight 700

lpenguin avatar Nov 28 '17 21:11 lpenguin

вау круто! Это прям очень вовремя т.к. мы активно начали фиксить сетевую игру.

stalkerg avatar Nov 29 '17 01:11 stalkerg

@lpenguin welcome to our telegram channel: https://t.me/vangers

stalkerg avatar Nov 29 '17 01:11 stalkerg

Огромное спасибо за такой апдейт! Следующим летом у Вангеров 20-ти летие. Будет здорово если слегка обновимся и всем подарим такую версию.

Кранку показал - доволен. :) Если нужна помощь какая-то по графике - пиши, не стесняйся, может быть найдем ресурсы. Я могу попинать Влада СПицкого (художник оригинальных Вангеров) - может быть он найдет время переделать интерфейс, если будет внятное ТЗ или параметры "как и что переделать"

cartoonka avatar Nov 30 '17 11:11 cartoonka