Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

repaint Jammer to same colour as Radar Detector and adjust the blurring effect it causes within its range #4769

Closed
wzdev-ci opened this issue Apr 9, 2018 · 47 comments

Comments

@wzdev-ci
Copy link
Contributor

wzdev-ci commented Apr 9, 2018

resolution_fixed type_patch (an actual patch, not a request for one) | by Forgon


The Jammer was hard to tell apart from the Counter Battery (see attached screenshots [raw-attachment:cb_and_jammer_distance_5000_old.png], [raw-attachment:cb_and_jammer_distance_2500_old.png], [raw-attachment:cb_and_jammer_distance_500_old.png]).

Its blurring effect also obscured unit outlines too much, making it difficult to distinguish units from a distance (see attached screenshot [raw-attachment:jammer_vision_blur_old.png]).

Therefore, I have repainted the Jammer to the same colour as the Radar Detector (compare [raw-attachment:jammer_model_old.png] to [raw-attachment:jammer_model_new.png]).
This makes it much easier to tell CB and Jammer apart (see attached screenshots [raw-attachment:cb_and_jammer_distance_5000_new.png], [raw-attachment:cb_and_jammer_distance_2500_new.png], [raw-attachment:cb_and_jammer_distance_500_new.png]).

The blurring effect is now far less intense, but more frequent (see attached screenshot [raw-attachment:jammer_vision_blur_new.png]).

Documentation for PIE format

I have made a few changes to the file './doc/PIE.md' to better explain the different coordinate notations used by PIE 2 and PIE 3. Two topics puzzled me especially and my explanations of them could surely be improved:

  • Why do helicopter models use some negative coordinates? Are their PIE3 UV values not supposed to range from 0 to 1?
  • What is the purpose of texture flag 4200? It is used in a few PIE 2 and PIE 3 models.

Overall the PIE format is now better documented, since I

  • included PIE 2 (rather than only PIE 3)
  • explained different coordinate systems used by PIE 2 and PIE 3
  • explained more polygon flags
  • mentioned materials directive
  • added tabs for examples when needed

Repositioning textures in texture page

The textures used by the Jammer were shared by CB, Commander, Heavy Rocket Bastion and Missile Fortress. Therefore, I had to copy them to a new location in the texture page './data/base/texpages/page-17-droid-weapons.png'.

A lack of space required shifting textures on that page and recalculating coordinates. For that purpose, I wrote an AWK script that allows moving a rectangular area for a given texture page by correcting the coordinates for each PIE files using it (see attached script [raw-attachment:'move_textures']). It is far from perfect, and must fail if only a part of one texture is chosen.

I carefully tested each texture I moved. Besides using my script, I found it useful to temporarily repaint textures in pure red, blue and green (whose hexadecimal values are #f00, !#00f, !#0f0). This makes it easy to remember where to look for unintended changes. Some files with repainted textures are attached.


After repositioning an emplacement foundations texture in GIMP, I executed

./move_textures 716 480 120 24 684 1000 page-17-droid-weapons.png

A texture used by Flashlight and EMP Missile Launcher overlapped with the Bunker Buster texture.
To correct this, I ran

for f in data/base/components/weapons/{gnmr,cy_}las.pie
do
    printf '%s\n' ',s/219/218/g' w | ed -s $f
done

I also removed a few unused pixels beneath the texture.
To ensure they were really not needed, I checked the result of ./move_textures 796 480 76 4 0 0 page-17-droid-weapons.png.

Finally, I moved the texture in GIMP and shifted all required PIE coordinates by executing:

./move_textures 796 428 76 52 796 388 page-17-droid-weapons.png

A texture showing a red dot was unused. I moved it in GIMP and verified that nothing required it by checking the result of

./move_textures 792 504 56 56 368 304 page-17-droid-weapons.png

After repositioning a texture used for the left upper arm of heavy cyborgs in GIMP, I executed

./move_textures 488 392 28 52 432 304 page-17-droid-weapons.png

Finally there was enough free space on the texture page to copy the textures needed by the Jammer model. I copied them in GIMP and then executed:

  • for the mast:
git checkout $(./move_textures 892 196 52 200 820 440 page-17-droid-weapons.png | grep -vFx ./data/base/components/weapons/gnmecm1.pie)
  • for the dishes:
git checkout $(./move_textures 864 912 64 64 460 392 page-17-droid-weapons.png | grep -vFx ./data/base/components/weapons/gnmecm1.pie)

Repainting the Jammer

To use exactly the same golden colour as the Radar Detector, I first removed grey areas from its texture page
(see attached image [raw-attachment:page-59-more-weapons_rendered.png]).

GIMP's "Sample Colourise" tool did all the rest for me (see attached image [raw-attachment:gimp_sample_colourise.png]). It can be accessed via 'Colours->Map' in the menubar.

I tried to further improve colouring, e.g. by using the "Colourise Tool" and setting the "Hue" value to 38 and the "Lightness" value to -35 (see attached image [raw-attachment:jammer_model_alternative.png]). Yet overall I could not make the model much prettier, and since I am no artist and my colour vision might be poor I'll leave that task to others.

To preserve the red spot in the center of radar dishes, I copied it into a new GIMP layer, and, using the "Colour to Alpha" tool (found via 'Colours->Colour to Alpha' in the menubar) removed the colour !#8d8d8d from it. I then merged the layer down.

I hope my patch does not cause too much trouble for real artists, like the makers of Art Revolution.


Issue migrated from trac:4769 at 2022-04-16 13:04:54 -0700

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file cb_and_jammer_distance_500_old.png (148.6 KiB)

CB and Jammer towers and tanks next to each other at distance 500 before applying this patch series
cb_and_jammer_distance_500_old.png

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file cb_and_jammer_distance_2500_old.png (147.7 KiB)

CB and Jammer towers and tanks next to each other at distance 2500 before applying this patch series
cb_and_jammer_distance_2500_old.png

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file cb_and_jammer_distance_5000_old.png (146.7 KiB)

CB and Jammer towers and tanks next to each other at distance 5000 before applying this patch series
cb_and_jammer_distance_5000_old.png

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file jammer_vision_blur_old.png (523.7 KiB)

jammer vision blur before applying this patch series
jammer_vision_blur_old.png

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file gimp_sample_colourise.png (153.8 KiB)

repainting the Jammer with GIMPs "Sample Colourise" tool
gimp_sample_colourise.png

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file jammer_model_old.png (384.2 KiB)

view of Jammer in design screen before applying this patch series
jammer_model_old.png

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file jammer_model_alternative.png (385.7 KiB)

view of alternative Jammer colouring in design screen
jammer_model_alternative.png

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon edited the issue description

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file page-59-more-weapons_rendered.png (47.4 KiB)

texture page for Radar Detector without grey areas
page-59-more-weapons_rendered.png

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon edited the issue description

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file emplacement_foundations_page-17-droid-weapons.xcf (1219.9 KiB)

GIMP XCF file with coloured layers to check emplacement foundations texture

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file flashlight_emp_missile_launcher_page-17-droid-weapons.xcf (1221.6 KiB)

GIMP XCF file with coloured layers to check Flashlight and EMP Missile Launcher texture

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file red_dot_page-17-droid-weapons.xcf (1229.4 KiB)

GIMP XCF file with coloured layers to check red dot texture

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file heavy_cyborg_left_upper_arm_page-17-droid-weapons.xcf (1233.4 KiB)

GIMP XCF file with coloured layers to check heavy cyborg left upper arm texture

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file jammer_texture.patch (465.8 KiB)

patch file created with git format-patch (part 7/9)

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file jammer_changelog.patch (1.3 KiB)

patch file created with git format-patch (part 9/9)

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file jammer_blurring_effect.patch (0.7 KiB)

patch file created with git format-patch (part 2/9)

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file emplacement_foundations_texture.patch (413.5 KiB)

patch file created with git format-patch (part 3/9)

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file flashlight_emp_missile_launcher_texture.patch (485.2 KiB)

patch file created with git format-patch (part 4/9)

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file red_dot_texture.patch (521.2 KiB)

patch file created with git format-patch (part 5/9)

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 9, 2018

Forgon uploaded file heavy_cyborg_left_upper_arm.patch (511.7 KiB)

patch file created with git format-patch (part 6/9)

@wzdev-ci
Copy link
Contributor Author

Forgon uploaded file jammer_repainting.patch (469.4 KiB)

patch file created with git format-patch (part 8/9)

@wzdev-ci
Copy link
Contributor Author

Forgon uploaded file jammer_model_new.png (412.4 KiB)

view of Jammer in design screen after applying this patch series
jammer_model_new.png

@wzdev-ci
Copy link
Contributor Author

Forgon uploaded file jammer_vision_blur_new.png (545.2 KiB)

jammer vision blur after applying this patch series
jammer_vision_blur_new.png

@wzdev-ci
Copy link
Contributor Author

Forgon uploaded file cb_and_jammer_distance_500_new.png (150.3 KiB)

CB and Jammer towers and tanks next to each other at distance 500 after applying this patch series
cb_and_jammer_distance_500_new.png

@wzdev-ci
Copy link
Contributor Author

Forgon uploaded file cb_and_jammer_distance_2500_new.png (148.0 KiB)

CB and Jammer towers and tanks next to each other at distance 2500 after applying this patch series
cb_and_jammer_distance_2500_new.png

@wzdev-ci
Copy link
Contributor Author

Forgon uploaded file cb_and_jammer_distance_5000_new.png (147.0 KiB)

CB and Jammer towers and tanks next to each other at distance 5000 after applying this patch series
cb_and_jammer_distance_5000_new.png

@wzdev-ci
Copy link
Contributor Author

Forgon uploaded file jammer_page-17-droid-weapons.xcf (1235.4 KiB)

GIMP XCF file with layers which allows to easily repaint the Jammer

@wzdev-ci
Copy link
Contributor Author

Forgon edited the issue description

1 similar comment
@wzdev-ci
Copy link
Contributor Author

Forgon edited the issue description

@wzdev-ci
Copy link
Contributor Author

Forgon uploaded file pie_format_explanation.patch (13.6 KiB)

patch file created with git format-patch (part 1/9)

@wzdev-ci
Copy link
Contributor Author

Forgon uploaded file ticket_4769_all_9_patches.patch (2882.5 KiB)

all parts of this patch series joint into one patch file

@wzdev-ci
Copy link
Contributor Author

Forgon edited the issue description

@wzdev-ci
Copy link
Contributor Author

Forgon uploaded file move_textures (6.2 KiB)

AWK script that allows moving a rectangular area for a given texture page by correcting the coordinates for each PIE files using it

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> changed owner from `` to Forgon2100 <forgon2100@gmail.com>

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> changed resolution from `` to fixed

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> commented


In Warzone2100/warzone2100@e7f724c:

#CommitTicketReference repository="" revision="e7f724ce27350ea27fe81809c0ff15ff6c70a742"
fixes #4769: enhanced explanation of PIE format (patch 1/9) - included PIE 2 (rather than only PIE 3) - explained different coordinate systems used by PIE 2 and PIE 3 - explained more polygon flags - mentioned materials directive - added tabs for examples when needed - improved markup

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> committed [77]


In Warzone2100/warzone2100@77b45da:

#CommitTicketReference repository="" revision="77b45da26a849804915c1ab37c6672c8477d08d9"
fixes #4769: adjust blurring effect caused by Jammer within its range by making it less intense, but more frequent (patch 2/9)

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> committed [9]


In Warzone2100/warzone2100@9e15d90:

#CommitTicketReference repository="" revision="9e15d9004ffbeeecff18747210fdb23da09b1c9d"
fixes #4769: reposition emplacement foundations texture in texture page (patch 3/9)

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> committed [000]


In Warzone2100/warzone2100@000c5a6:

#CommitTicketReference repository="" revision="000c5a6af70bf3c4f81909b9be6d69d443ad1178"
fixes #4769: reposition texture used by Flashlight and EMP Missile Launcher in texture page (patch 4/9)

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> committed [73]


In Warzone2100/warzone2100@73a8313:

#CommitTicketReference repository="" revision="73a8313d0c444283bc76285552658ab42d79ca68"
fixes #4769: reposition unused red dot in texture page (patch 5/9)

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> committed [595149]


In Warzone2100/warzone2100@595149e:

#CommitTicketReference repository="" revision="595149e5ee183b8d44d695d8936c47e751e3b3bc"
fixes #4769: reposition texture used for left upper arm of heavy cyborgs in texture page (patch 6/9)

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> committed [2]


In Warzone2100/warzone2100@2f31420:

#CommitTicketReference repository="" revision="2f31420a8e82fbcb6fb5e51756897eb635249aec"
fixes #4769: reposition textures used by Jammer in texture page (patch 7/9)

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> commented


In Warzone2100/warzone2100@b4b14b3:

#CommitTicketReference repository="" revision="b4b14b384c17c3f7718cf05d3a89cd773f0e30a0"
fixes #4769: repaint Jammer to same colour as Radar Detector (patch 8/9)

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> commented


In Warzone2100/warzone2100@d03d9cd:

#CommitTicketReference repository="" revision="d03d9cd603c64d5bd87d0f5654833b5ff312dce0"
fixes #4769: updated ChangeLog (patch 9/9)

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> committed [58]


In Warzone2100/warzone2100@58e78a2:

#CommitTicketReference repository="" revision="58e78a22f48375273f258e294ea8bc061fac7f48"
Fix documentation of PIE 2 format

* PIE 2 files can include all extensions available in PIE 3 since
  bc80e9b20f0600e9646d274d15f2d0656543d162
* coordinate notation is the only difference between the PIE versions

Thanks to inodlite for noticing the mistake.

Refs #4769
Fixes #325
Fixes #334

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant