Rotate graphics 45 degrees to be upright?

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
captain bananas

Rotate graphics 45 degrees to be upright?

Post by captain bananas »

Hello--

I've never played Ultima, but looking at the screenshots, it seems like the obvious mod to make would be one to rotate the game world 45 degrees clockwise, such that characters stand upright, etc. The present perspective is somewhat nauseating.

I have not seen screenshots of such a mod. Does such a mod exist? How complicated would it be to do such a thing with the existing Exult code?
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

Very complicated. All graphics would need rerendering and you wouldn't be able to make it legally available. The engine would need time consuming testing and so on.
I like the perspective.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
lkasdjflkasjd

Re: Rotate graphics 45 degrees to be upright?

Post by lkasdjflkasjd »

bummer. thank you for the answer :)
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Colourless »

As a curiosity I took some screenshots and rotated them to see what it would look like. The results were surprisingly very nice.

Image

Image

Image

Getting it to work realtime in exult would require a number of changes. In fact a significant number of changes. However it would in theory be possible to do it. You wouldn't need to redraw the sprites.

Of my head the main issues that would need dealing with:
1) Exult can't deal with arbitrary view port transformation
2) Exult can't deal with having a different transformation on the world to the user interface
3) Exult assumes that the what it displayed on screen is a nice rectangle of tiles

Of those number 3 is the real problem. Simplest way to fix it would be to just expand the view port then rotate. In my test screenshots (ignoreing scaling) I ran the view port at 512x384 rotated then cropped to 320x200 and it 'just fit' with no missing data (320x240 was too big!). That was a lot of non visable area that exult thinks is on screen and is far from idea and would probably create a number of gameplay issues. Off screen wouldn't actually mean off screen anymore.

Of course rotating the viewport 45 degress makes the perspective quite similar to Ultima 8 and as such would probably be able to borrow code/algorithms from Pentagram wrt to calculating good screen visibility.
resle

Re: Rotate graphics 45 degrees to be upright?

Post by resle »

Considering the onscreen objects are never that much in U7, and given today's machines (even the slowest ones) computing power - visibility of a "renderable entity" should be easy to do. Take the bounding rectangle of the object's base, rotate it 45 degrees - if it collides with the world-to-screen rectangle then the object must be rendered.

You could just render everything with the older perspective BUT applying the aforementioned trick - then rotate the screen before presenting it. At this point, #2 becomes the only issue and what must be done is adding an arbitrary transformation "layer" to every mouse-to-world interaction.
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Colourless »

Calculating if an object is potentially visable is quite trivial. The problems i forsee is the usecode making assumptions that the screen is 40 tiles wide and 25 tiles high (320x200 pixels). These are the same problems faced if running at a higher resolution. Of course we already support higher resolutions 'out of the box' and this wouldn't be 'that much' higher.

For a 320x200 rotated screen the dimetions of the buffer need to be 368x368 (320/sqrt(2) + 200/sqrt(2)).

This shows how things compare between the 368x368 buffer, the rotated section, and the usual 320x200 viewport
Image

Having made that image, I'm less inclined to think there would be any major issues
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

I don't think I could get used to it.
While the NPCs all look nice I don't like that everything else is now at the wrong angle ;(
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Rotate graphics 45 degrees to be upright?

Post by i30817 »

The objects become curiously flat
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by marzo »

It looks flat because the z axis is half the length it "should" be for a true isometric perspective; since we all played games with (almost) true isometric perspective, we know how they "should" look, and the rotated version of U7's cabinet projection does not match this expectation.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

Don't overlook what Colourless hinted at with his comparison to pentagram: N S E W will be in the corners of the screen. No longer at top, bottom and the sides. Something I disloked about u8...
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
TDI

Re: Rotate graphics 45 degrees to be upright?

Post by TDI »

I don't know what renderer Exult uses, but rotating the screen 45° should not be very hard. Maybe (probably) I'm underestimating things, but wouldn't it be enough to:

1. Apply a 45° rotation transformation.
2. render the world
3. Apply a -45° rotation transformation
4. render the interface/gumps/text/dialoge, whatever its called
5. Provide a function that transfers mouse X/Y coordinates to world X/Y for when user clicks inside world

The problem with this is that the screen will be clipped as in Colourless' screenshot, but this could easily be solved by rendering a larger area (you do this with higher resolutions, so it's already possible).

Maybe someone can explain the part that I'm underestimating.
Scythifuge
Posts: 384
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Scythifuge »

This perspective is the same one used in Ultima Online. In fact, when I want to study some UO sprites for ideas for Savage Empire or other mod project sprites, I rotate the screenshots with a negative 45 turn to get them into the Ultima VII cabinet projection.

I think that having a version of Exult that rendered Ultima VII this way would be a neat & fun option in order to play the game in a different way. Plus making new games/mods would have more options.

Sprites with issues being rotated could be redrawn in order to fit better.
Jaesun
Posts: 70
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Jaesun »

I have to say I do really like the 45 degree look. There is a program Rotsprite: http://info.sonicretro.org/RotSprite

I have used this to scale a few graphics for another engine I am working in. Just posting this if it possibly could be of any help.
Scythifuge
Posts: 384
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Scythifuge »

I'll check out the program as I need to rotate many objects for Savage Empire & other projects.
cma

Re: Rotate graphics 45 degrees to be upright?

Post by cma »

Rotate U7 map 45 degrees on the fly in Excult is very doable. I did some hacking of Excult 1.4.9rc1 in Windows and render a bigger map, rotate and copy it to screen. The rotated map looks blurry as the rotated pixels do not map to on screen pixel 1 to1. Converting mouse clicks to match rotated map is not easy, and the code looks quite complex to me. So far I have single left click(inspect) , single/double right click(walk) kind of working. Still a long way to go.

http://farm8.staticflickr.com/7261/7627 ... d43c_z.jpg
http://farm8.staticflickr.com/7274/7627 ... ac97_z.jpg

(edit by dominus:urlified)
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Malignant Manor »

I like the perspective but I hate how the graphics are garbled.
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Colourless »

You'd want to upscale and rotate at the same time to get much nicer looking rotation.
cma

Re: Rotate graphics 45 degrees to be upright?

Post by cma »

To minimize changes to exult, I copy the rotated map back to original 320x200 drawing surface where excult put gump and text on top of it. Excult scale up the final image at the end. This method does not allow me to rotate and scale up at the same time. I guess I need to rethink my strategy.
Scythifuge
Posts: 384
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Scythifuge »

This is neat & I hope that it can be accomplished in a useable form.
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Colourless »

You'd need to split the rendering into 2 different parts and composite them together (world and everything else). The simpler scalers should preserve alpha channel so you could draw gumps into a buffer thats got a background colour thats got an alpha value set (need to edit the palettes for this) then upscale and use the alpha values for a mask when compositing onto the scaled+rotated world view.
cma

Re: Rotate graphics 45 degrees to be upright?

Post by cma »

An update. Did what Colourless Dragon said: render map to a new window and scale and rotate it 45 degree. then composite it with the gump with alpha background. I could not find alpha channel support in any scaler so I modified PointScaler x2 to make it support alpha (index 255, had to change the palette code to reserved it). The map graphics look much better now IMHO.

I also had the basic mouse navigation and mouse/object interaction working. I am sure I still missed some special mouse event handling cases. At least I can work around Trinsic and interact with things now.
cma

Re: Rotate graphics 45 degrees to be upright?

Post by cma »

Screenshot

Image

(Edit by dominus: used the right bracket for img)
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Colourless »

Looks nice! Good job
Jaesun
Posts: 70
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Jaesun »

That looks pretty cool!
Kalos Dragon

Re: Rotate graphics 45 degrees to be upright?

Post by Kalos Dragon »

Anyone who has played Ultima Online will feel fully at home in Exult, now, for a new sun has risen, and it is but half of a right angle from prior times.

Thou art truly a wise man, ye who began rolling the ball of revolution.
Do not listen to naysayers, for they are big poopy head.
Instead, follow thine own path, and revolutionize the past to make way for the future.
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by drcode »

That looks awesome! Ultima 7 from a whole new angle.:-)
WtF Dragon

Re: Rotate graphics 45 degrees to be upright?

Post by WtF Dragon »

A good point was made about how this view will feel at home to UO players, and frankly I kind of like it as well. U7 did always look a little odd to me, but the rotated view actually looks quite pleasant.

Any chance this mod could get released in the near future? I'm sure there'd be a few people very keen to give it a play.
Incriptus

Re: Rotate graphics 45 degrees to be upright?

Post by Incriptus »

First off, Good Job!

Second off, It makes me incredibly dizzy looking at it! It's like the world has been twisted into something unnatural. I never did play Ultima Online but i've played U7 so many times that rotating it just feels strange.

Of course I would give U7 Rotated a play through, as I like any excuse to play the game again!
Kalos Dragon

Re: Rotate graphics 45 degrees to be upright?

Post by Kalos Dragon »

Quote: "It's like the world has been twisted into something unnatural. "

I then look at a screenshot.
What direction are the trees facing?


Up?

My God, that is so... twisted and unnatural! ;)
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

Please no fight over this ;) it will of course seem strange for many people as it IS different than how it used to be. Nothing to fight over...

Cma: is it playable yet?
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
voskat

Re: Rotate graphics 45 degrees to be upright?

Post by voskat »

Love this. Must play.
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by drcode »

If it's playable and can be switched on/off, that would make a very nice option.
Browncoat Jayson

Re: Rotate graphics 45 degrees to be upright?

Post by Browncoat Jayson »

Very nice job. Can't wait to be able to try it!
cma

Re: Rotate graphics 45 degrees to be upright?

Post by cma »

Thanks for all the good words. The rotated view looks okay but I am finding new mouse issue as I venture further into BG (i.e board a carriage but it does not go the direction I click ). I will share this code once I get the major bugs out of the way.
paulo

Re: Rotate graphics 45 degrees to be upright?

Post by paulo »

Guess the mouse interface is not unified across all the code?
cma

Re: Rotate graphics 45 degrees to be upright?

Post by cma »

Hi All,
This rotate world mod is still a prove of concept. I have a Windows executable available if people want to give it a try. It currently only support 320x200 game area and 2xSaI scaler (see installation below). It works with Excult-1.4.9-rc1 installation.

Download link:
https://www.dropbox.com/s/9l4jk0hd33fnv ... rotate.exe

Installation:
Copy Excult-rotate.exe to the installation directory of a existing Excult 1.4.9-rc1 installion

Create a custom key binding and map a key for toggling rotation
- copy bgdefaultkeys.txt in Excult directory and name it my_keys.txt
- edit my_keys.txt and add a new line at the end like this:
Q toggle_rotate_world # hit Q for toggling rotation

- edit Excult.cfg and change tag to include full path to my_keys.txt

....

C:\Exult\my_keys.txt



Run Excult-rotate.exe , select setup and video options. see screenshot below. Option mark by the red rectangle must be set to that exact value. save the option and start a new Blackgate game. Hit Q to toggle rotate world.

Image
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

Can you put the source or a patch up so I can natively compile it on OS x? I *will* try it in Wine though.
Thanks for uploading this.

Edit: looks very nice. After just playing a bit with it it's hard to come to terms with either view. Both feel wrong and right now :)
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Mimu

Re: Rotate graphics 45 degrees to be upright?

Post by Mimu »

Ran it with the current snapshot using --nocrc. Works fine!

Although now the characters all look really weird if you try to walk straight up/down/left/right... in the native angle, approximating diagonal directions with the closest facing sprite is somehow easier to swallow. No easy solution for that that I can think of!

Another version or two of fixes and improvements, and I may be compelled to do a full playthrough with this.
cma

Re: Rotate graphics 45 degrees to be upright?

Post by cma »

Here is a rotate world patch for official Exult 1.4.9rc1 source package.

https://www.dropbox.com/s/3c8bqa3r947bd ... e.patch.gz
Incriptus

Re: Rotate graphics 45 degrees to be upright?

Post by Incriptus »

My previous attempt at humor via exaggeration failed, so my appologies.

I've wandered around Britannia 45, so as soon as my busy video game schedual clears up [There I go, trying to be funny in a post, ahhh!], I'll probably give it a play through.

Again, Thanks for sharing
cma

Re: Rotate graphics 45 degrees to be upright?

Post by cma »

Please be aware that rotate world is a work in progress mod and you could run into unknown bugs. It seems to work fine but it was not play test extensively. My hope is toggling back to original perspective temporary may allow you to overcome display bugs and not get stuck.

P.S. When preparing the rotate patch I found a bug in the windows executable causing object to be invisible when being dragged in normal perspective. This problem was fixed and follow the old url will give you the updated executable.
Kalos Dragon

Re: Rotate graphics 45 degrees to be upright?

Post by Kalos Dragon »

This is AWESOME!
Ugh...

Re: Rotate graphics 45 degrees to be upright?

Post by Ugh... »

I followed all of cma's steps and yet can't get the rotation to work. I copied Exult-rotate.exe to the Exult folder, saved a modified version of bgdefaultkeys.txt as my_keys.txt, edited AppData\Exult\exult.cfg to use this file, and set the video options like they're in cma's screenshot, yet nothing happens when I hit Q. What am I doing wrong!?
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

Go through the steps again. Are you running exult-rotate.exe and not exult.exe? Also stdout .txt will tell you which keyfile gets used.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Incriptus

Re: Rotate graphics 45 degrees to be upright?

Post by Incriptus »

[Humor] What play an Ultima game where you can run into unknown bugs & hasn't been extensively play tested? SO . . . it'll be just like old times! [/Humor]
Scythifuge
Posts: 384
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Scythifuge »

I ran around a bit in BG & looked at some of my Savage Empire sprites in the new perspective.

My comment on this thus far is AWESOME.

The potential here is very great. I hope that future revision supports all of the video modes (I play the games to look as close as I can get them to the originals with aspect correction on my lcd monitor.)

There was an image file floating around on the net some years ago where someone rotated a BG screenshot to this angle & I thought then that being able to play the game like that would be neat as well as refreshing after playing the living daylights out of The Complete Ultima VII.

Plus it makes me understand my stint in Ultima Online back in the early 2000's...
Kalos Dragon

Re: Rotate graphics 45 degrees to be upright?

Post by Kalos Dragon »

Guys, if you've tried this out, definitely, definitely, post screenshots.
Mimu

Re: Rotate graphics 45 degrees to be upright?

Post by Mimu »

A few screens of interest:

Image
Image
Image
Image
Image
Image
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Colourless »

I really like what it looks like. Just find the sprites having only 4 directions they face a little annoying. Really needs 8 (or 5) direction sprites like other games have.
cma

Re: Rotate graphics 45 degrees to be upright?

Post by cma »

I like the look in those screenshots. Here is an update to the Windows executable and patch for the source code. This new version supports all fill mode plus bigger window size and game area. Rotate world still requires 2xSaI scaler.

Windows executable
https://www.dropbox.com/s/1exdajp0fpcbx ... ate-v2.exe

patch for 1.4.9rc1 source
https://www.dropbox.com/s/2bqk9vbn558cp ... 2.patch.gz
Locked