OpenXcom Forum

Contributions => Programming => Topic started by: skymarshall on August 19, 2014, 01:06:26 am

Title: Ufopaedia screens for Armor and Vehicles
Post by: skymarshall on August 19, 2014, 01:06:26 am
I'm new to openxcom and decided to take a look at the source code for my own amusement - it is a very nicely coded project and lots of fun to play with :)

One of the minor things that irritated me on the original was the inconsistent look of the ufopaedia screens, especially that the screens for new armor and vehicles looked really uninspiring despite these techs being a major deal in the game.  OpenXcom has made some improvements by putting in extra information, but the inconsistent look is still there.  I thought I'd try improving this as a way to find my way around the code.

Here's how armor and vehicle screens look in openxcom (excuse white borders from sloppy image grabbing):

(https://i.imgur.com/Qy9PVxD.gif)
(https://i.imgur.com/Jk0Y0xD.gif)

By comparison, this is how the equipment screens look:

(https://i.imgur.com/fP67TKT.gif)

By fighting with palattes to create a new background image to match the weapons/ammo pages, and adding a few (hacky) lines of code to assemble unit sprites on the vehicles ufopaedia page, I have a much nicer look for the armor and vehicle pages on my local build:

(https://i.imgur.com/U57rpJk.gif)
(https://i.imgur.com/5qZmegI.gif)

Does anyone else care about this or just me?  If anyone has any opinion on whether this is worth doing properly and submitting for consideration, let me know.
Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: SIMON BAILIE on August 19, 2014, 01:24:51 am
I agree, what you are proposing would be a big improvement, good luck!
Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: ivandogovich on August 19, 2014, 02:28:22 am
I've been trying to do some Ufopedia modding with little success.  Do you have to use a custom .exe for your mod to work?  If so that would conflict with Soldier Diaries, which I want to keep using. 

I'm very interested in what you are doing here, and will be following this closely.

Cheers, Ivan :D
Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: Arthanor on August 19, 2014, 05:53:22 am
A big improvement as far as I am concerned! I wish you the best getting it in the main code!
Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: Solarius Scorch on August 19, 2014, 08:13:12 am
I love the idea of having pics for tanks, I've always wanted them.

But I don't like the armour change much, they look way better on black. Yes, I know it makes the Ufopaedia inconsistent, but still.
Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: skymarshall on August 19, 2014, 10:28:21 am
Wow - I was 50/50 that this thread would go completely ignored!

@ivandogovich - yeah, a tiny code change is needed to put a background pic on the armor page, although you could do it in a very hacky way without a code change for a mod.

My change was to add a line of code to the ArticleStateArmor constructor:

      _game->getResourcePack()->getSurface("BACK_ARMOR.BMP")->blit(_bg);

I then created a BACK_ARMOR.BMP from the in-game BACK08.SCR, which is the equipment page background.

If you wanted to do it without a code change for a mod, I think you could do it by creating a duplicate armor in the "armors" section of the rules, give it a modified inventory sprite with a full page background, and then reference the duplicate armor from the ufopaedia entry instead of the actual one. 


@Solarius - yep, whether or not it looks better is totally subjective.  What would you think to adding an optional background image in the armor ufopaedia rules, allowing modders to have (potentially different) background sprites at their discretion?

Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: Dioxine on August 19, 2014, 10:51:26 am
Well to be honest I don't find these new entries "nicer" in any way... I like the original setup where every kind of entry has a different layout (and I think Microprose designers shared that view). If you simply want to have tank's picture and extended armor stats for it, it's as easy as creating ufopaedia entry for TANK_ARMOR...
Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: skymarshall on August 19, 2014, 10:59:14 am
I wonder if this layout would work for Solarius:

(https://i.imgur.com/ZK9WaJm.gif)


Agree with Dioxine that the nicest look for the tanks would be to have an artist do some nice 320x200 images for the vehicles similar to the craft screens.  You can almost do that without a code change, but would probably want to be able to move the stat and text sections around, which you can't do just from the ruleset. 

Mostly, I wanted to experiment and see how easy it was to print up unit battlescape sprites on the UFOpaedia screens - I think that could be quite useful for modders who want to show pictures on their UFOpaedia pages but can't find relevant art.
Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: Gifty on August 19, 2014, 11:23:25 am
I like this, I never liked how the armor entries just kind of existed in this black void.
Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: Solarius Scorch on August 19, 2014, 12:45:05 pm
I wonder if this layout would work for Solarius:

(https://i.imgur.com/ZK9WaJm.gif)

Yeah, it's a reasonable compromise... But it doesn't look as good as the original, I'm afraid. Which I consider a bigger problem than the inconsistency.
Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: skymarshall on August 19, 2014, 01:40:02 pm
OK - I think opinion on this is sufficiently divided that my new screens wouldn't suit everyone and so they definitely shouldn't be inflicted on the main build.  It stays on my build though, that's the beauty of open source :)

What would be very useful for modding (and not detract from replicating the original game) is the ability to have

- configurable background image and choice between ufopaedia/battlepedia palette
- battle scape unit images
- moveable text and stat boxes (as for craft)

as options in the ruleset for the vehicle and armor ufopaedia screens.   The first especially, would be a very minor code change, and give an incentive for a talented artist modder to produce some professional looking screens for the tanks.


Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: clownagent on August 22, 2014, 09:16:09 pm
More consistent Ufopedia entries would be really an improvement, especially for the HWP pages.
Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: skymarshall on August 22, 2014, 10:39:35 pm
Sadly, all this is a matter of taste rather than my ideas being a strict improvement - so replicating the original game has to win out for the moment

I like my changes, but unless I hear loud noises from the community to submit them properly, I think they just stay on my local build
Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: Aldorn on August 23, 2014, 11:51:01 am
I agree for both HWP and Armor Ufopaedia  :)
Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: Vulgar Monkey on August 23, 2014, 05:13:40 pm
I've actually already got some 3d models of tanks and a redesigned skyranger if anyone wants them.
I'd say they'd be a suitable basis for a paintover, but at low-resolution and 256 colour you might as well just do a straight conversion - I can't see it being possible to do much other than maybe use a few filters to make sure the image indexing comes out nicely.

(https://i.imgur.com/VCNQIMU.jpg)
(https://i.imgur.com/r86Bf4H.jpg)
(https://i.imgur.com/JG68eZ5.jpg)
(https://i.imgur.com/pqQ2rXE.jpg)
(https://i.imgur.com/u47FX9Z.jpg)
(https://i.imgur.com/DyMFHBq.jpg)
(https://i.imgur.com/kcSlkIp.jpg)
(https://i.imgur.com/iNLV1U0.jpg)


I never actually bothered to mention it because.....well, we didnt have images in the research screens!

I was going for something a bit like the Wiesel mini-tank, but the funny thing is that if you look at some of the little TALON (?) drones being tested out by the US army atm, they can mount just as much firepower on a chassis half the size! If we dont want the HWP tanks to be underpowered, I guess we can say narratively that the extra mass comes from armour, fuel and extended rough-terrain ability or something. Plus they're much faster, so it's mostly engine I guess.

Actually, one thing I did think with these is that the storage bins could carry gear and the rack along the rear could seat troops or carry the wounded. Is it possible to give vehicles their own inventory space?
Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: Solarius Scorch on August 24, 2014, 12:19:19 am
I'm so in love with your HWPs... (https://www.traditionalfisherman.com/images/smilies/icon_drool.gif)
Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: smexyvami on August 24, 2014, 06:48:29 am
I wonder if this layout would work for Solarius:

(https://i.imgur.com/ZK9WaJm.gif)


Agree with Dioxine that the nicest look for the tanks would be to have an artist do some nice 320x200 images for the vehicles similar to the craft screens.  You can almost do that without a code change, but would probably want to be able to move the stat and text sections around, which you can't do just from the ruleset. 

Mostly, I wanted to experiment and see how easy it was to print up unit battlescape sprites on the UFOpaedia screens - I think that could be quite useful for modders who want to show pictures on their UFOpaedia pages but can't find relevant art.

i like this vary mutch :D hope you can make this into a mod plugin
Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: skymarshall on August 24, 2014, 12:53:29 pm

@smexvamy - It needs a code change - admittedly a tiny one - and that sadly means it can't be done as a mod plugin :(

@VM - those models look really nice!  If you're not planning on doing further work on them yourself, please think about posting the files up somewhere so that someone else can continue your efforts. 



Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: Vulgar Monkey on August 24, 2014, 11:22:20 pm
I've been keeping myself busy with other stuff lately but those models were done almost a year ago. I partly stopped because I was reaching the limit of what my computer and sketchup could handle, but if anyone else wants a crack at them then they're freely available on the sketchup warehouse. Should be easy enough to find via a quick search.

I'd be pretty interested to see what happens tbh.
Title: Re: Ufopaedia screens for Armor and Vehicles
Post by: RSSwizard on August 25, 2014, 05:30:48 am
Wow those are some EXCELLENT tanks man, very realistic to the way they would probably be designed.

I wasnt aware that Google Sketchup was capable of building complex models like that, I thought it had restrictions on what kind of surfaces/shapes you could build with it.


In respect to the UfoPaedia UI style . . . I always thought tthe detailed graphical style and orientation of the TFTD UfoPaedia was just over the top. It could have been improved upon, but not by much. It was one of the parts (among many) that I enjoyed about that game, over the original.