Page 1 of 3
Rotate graphics 45 degrees to be upright?
Posted: Sat Dec 03, 2011 7:04 am
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?
Re: Rotate graphics 45 degrees to be upright?
Posted: Sat Dec 03, 2011 7:29 am
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Sun Dec 04, 2011 12:22 am
by lkasdjflkasjd
bummer. thank you for the answer
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Dec 05, 2011 3:25 am
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.
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Dec 05, 2011 5:50 am
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Dec 05, 2011 9:01 am
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
Having made that image, I'm less inclined to think there would be any major issues
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Dec 05, 2011 9:01 am
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 ;(
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Dec 05, 2011 9:31 am
by i30817
The objects become curiously flat
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Dec 05, 2011 11:05 am
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Dec 05, 2011 11:37 am
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...
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Dec 05, 2011 4:04 pm
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Dec 05, 2011 5:47 pm
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Wed Dec 07, 2011 2:28 am
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Wed Dec 07, 2011 6:27 am
by Scythifuge
I'll check out the program as I need to rotate many objects for Savage Empire & other projects.
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Jul 23, 2012 3:37 am
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)
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Jul 23, 2012 3:57 am
by Malignant Manor
I like the perspective but I hate how the graphics are garbled.
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Jul 23, 2012 9:38 am
by Colourless
You'd want to upscale and rotate at the same time to get much nicer looking rotation.
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Jul 23, 2012 4:14 pm
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Tue Jul 24, 2012 12:56 am
by Scythifuge
This is neat & I hope that it can be accomplished in a useable form.
Re: Rotate graphics 45 degrees to be upright?
Posted: Tue Jul 24, 2012 1:32 am
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Fri Sep 28, 2012 9:34 pm
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Fri Sep 28, 2012 9:37 pm
by cma
Screenshot
(Edit by dominus: used the right bracket for img)
Re: Rotate graphics 45 degrees to be upright?
Posted: Sat Sep 29, 2012 4:22 am
by Colourless
Looks nice! Good job
Re: Rotate graphics 45 degrees to be upright?
Posted: Sat Sep 29, 2012 10:38 am
by Jaesun
That looks pretty cool!
Re: Rotate graphics 45 degrees to be upright?
Posted: Tue Oct 02, 2012 9:08 pm
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Wed Oct 03, 2012 4:37 pm
by drcode
That looks awesome! Ultima 7 from a whole new angle.
Re: Rotate graphics 45 degrees to be upright?
Posted: Wed Oct 03, 2012 11:41 pm
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Thu Oct 04, 2012 2:28 am
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!
Re: Rotate graphics 45 degrees to be upright?
Posted: Thu Oct 04, 2012 4:51 am
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!
Re: Rotate graphics 45 degrees to be upright?
Posted: Thu Oct 04, 2012 5:45 am
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?
Re: Rotate graphics 45 degrees to be upright?
Posted: Thu Oct 04, 2012 9:09 am
by voskat
Love this. Must play.
Re: Rotate graphics 45 degrees to be upright?
Posted: Thu Oct 04, 2012 9:24 pm
by drcode
If it's playable and can be switched on/off, that would make a very nice option.
Re: Rotate graphics 45 degrees to be upright?
Posted: Thu Oct 04, 2012 9:56 pm
by Browncoat Jayson
Very nice job. Can't wait to be able to try it!
Re: Rotate graphics 45 degrees to be upright?
Posted: Fri Oct 05, 2012 5:03 am
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Fri Oct 05, 2012 3:16 pm
by paulo
Guess the mouse interface is not unified across all the code?
Re: Rotate graphics 45 degrees to be upright?
Posted: Thu Oct 11, 2012 4:01 am
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Thu Oct 11, 2012 10:02 am
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
Re: Rotate graphics 45 degrees to be upright?
Posted: Thu Oct 11, 2012 4:43 pm
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Sat Oct 13, 2012 6:53 am
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
Re: Rotate graphics 45 degrees to be upright?
Posted: Sat Oct 13, 2012 5:54 pm
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
Re: Rotate graphics 45 degrees to be upright?
Posted: Sun Oct 14, 2012 3:10 am
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Sun Oct 14, 2012 6:31 am
by Kalos Dragon
This is AWESOME!
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Oct 15, 2012 9:10 pm
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!?
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Oct 15, 2012 9:51 pm
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Oct 15, 2012 10:55 pm
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]
Re: Rotate graphics 45 degrees to be upright?
Posted: Tue Oct 16, 2012 11:58 pm
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...
Re: Rotate graphics 45 degrees to be upright?
Posted: Fri Oct 19, 2012 4:56 am
by Kalos Dragon
Guys, if you've tried this out, definitely, definitely, post screenshots.
Re: Rotate graphics 45 degrees to be upright?
Posted: Mon Oct 22, 2012 11:35 am
by Mimu
Re: Rotate graphics 45 degrees to be upright?
Posted: Tue Oct 23, 2012 3:39 am
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.
Re: Rotate graphics 45 degrees to be upright?
Posted: Wed Oct 24, 2012 3:39 am
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