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
Kalos Dragon

Re: Rotate graphics 45 degrees to be upright?

Post by Kalos Dragon »

I've played around with the rotate patch. It works very well, albeit slightly slow presently.

There are issues with:

-Mouse alignment with object about to be dragged
-Object being dragged reverts to the original, non-rotated display.
William

Re: Rotate graphics 45 degrees to be upright?

Post by William »

Sadly I haven't been getting this to work yet. As one who remembers getting Ultima 7 to run in dos before the days of Exult, I like to think I should be able to figure this patch out, but apparently I can't.

I have:
-Moved your .exe into the same folder as the usual exult.exe
-Copied bgdefaultkeys.txt, renamed it my_keys.txt, and added the new line at the end of it
-Edited the exult.cfg to read (my exult program is found at C:\exult


c:\exult\my_keys.txt


I run the rotate.exe, change to the proper video options, then start a new game.

So far I haven't gotten it to rotate. What am I doing wrong?

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

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

Did you hit q? And are you using the right exult.cfg?
--
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!
Kalos Dragon

Re: Rotate graphics 45 degrees to be upright?

Post by Kalos Dragon »

You need to modify the my_keys.txt to include "q" as a hotkey.

Quoted from cma:

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
William

Re: Rotate graphics 45 degrees to be upright?

Post by William »

Wow thanks for the quick responses!

Uh oh, what is the right exult.cfg? I'm using the exult.cfg file that is in the same directory as the exult.exe file. I am hitting q, and I did modify the my_keys to include the new line with the q.
William

Re: Rotate graphics 45 degrees to be upright?

Post by William »

Aha, I found it! I wasn't aware that the exult.cfg in the Exult folder was not the real one! Thanks for the help!
Kalos Dragon

Re: Rotate graphics 45 degrees to be upright?

Post by Kalos Dragon »

Yeah, Exult does that for some reason.

I gotta call shenanigans on it.

C'est la vie.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

Yeah, Exult does that for some reason.
because with modern Windows OS you are by default not allowed to write to files in c:/program files. You'd still have an exult.cfg but the actual file being used would be even more annoyingly in a different folder in the user folder....
--
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!
Kalos Dragon

Re: Rotate graphics 45 degrees to be upright?

Post by Kalos Dragon »

Ah, the perils of installing to C:\Program Files\, as opposed to, I don't know, C:\Games\.

However, we digress from the actual topic.

CMA, how goes thy work, good sir?

Shirley thou hast progressed with the Ultima 7 upright world patch.

What say thee?
Smoke
Posts: 9
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Smoke »

I'm sorry, I didn't read this entire topic, but, the solution to this is simple, assuming you use a matrix.

You just setup up your rendering to use a matrix, apply a rotation to matrix for the world, objects, etc, excluding UI, and other things you don't want rotated.

Seriously, use a matrix, it's the EASIEST way to handle rendering, they can be a pain to setup, and get right, but, once implemented, you can zoom\rotate\move any object however you want with little trouble.
Nanihikaru

Re: Rotate graphics 45 degrees to be upright?

Post by Nanihikaru »

Works! it also made the game look like Ultima 8!

except it's too slow on my laptop makes it hard to play.


I wonder if is possible to pre-render all world tiles 45' and modify the game view port and render to accommodate the new coordinate system.
Smoke
Posts: 9
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Smoke »

There doesn't seem to be an "edit" button. ?

Anyways, I just wanted to add that the majority of games use a matrix for handling rendering, and since the matrix does all the math for you, it will likely make the game run better, or at least feel better\smoother. (Google should get you sorted, search for: SDL Camera Matrix 2D)

Aside from the rotation fix being applied, I'd also love to see zooming implemented into the camera.

@Nanihikaru, what I've suggested should fix that problem, however, during a quick search, I read that SDL doesn't support hardware transforms, there seems to be a better version of SDL(or something similar?) which does, however, it may not be as portable. (I don't really know this API that well, I generally use DX myself, so, just, research it a bit I'm sure you guys will find all you need via Google.)
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by marzo »

@Smoke: there is a difference between not wanting to read the whole thread and not wanting to put the slightest bit of effort in attempting to get updated in the topic; the post right above yours asks about the status of a patch -- which would imply to anyone with the least bit of coding experience to suspect that someone has solved the problem. Which is the case here: just a few page up presses from your post was a set of screenshots of a working demo, as well as source code patches.

And yes, we know about matrices. They are useful, yes, but not as "magical" as you may have been led to believe.

But enough of grumbling; the rotated graphics are really beautiful! The non-isometric nature of the end graphics actually makes them look more realistic than a normal isometric perspective does, at least to my eyes.
------
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]
Smoke
Posts: 9
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Smoke »

"not wanting to put the slightest bit of effort in attempting to get updated in the topic"

I read the topic(mostly), and I saw the patch.

But, I think you're killing performance, and likely causing bugs by doing it that way, so, I offered another option.

Regardless, I was completely up to date, you assume too much.

------------

"post right above yours asks about the status of a patch... which would imply to anyone with the least bit of coding experience..."

I posted before him, originally, but yeah, I should have skipped ahead into the future, and saw his post, then went back into the past, and warned myself about making that post...

Seriously, you should get up to date on the topic, you must not have the least bit of 'coding' experience. (Do you see how ridiculous that sounds?)

-----

"And yes, we know about matrices. They are useful, yes, but not as "magical" as you may have been led to believe."

I don't think you do, and I wasn't led to believe anything, I know.

--

"But enough of grumbling"

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

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

You wrote yourself you didn't read the whole thread.
Marzo was refering to the post directly above your 1st post.
Before arguing for matrices please take a look at our code and see if that is even applicable. Same for zooming...

Enough arguing about it, if you want to really help, please first look at the code and give practical advice instead of theoretical.

Btw, no edit possibility of topics because we like to keep the forum as simple as possible.
--
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!
Smoke
Posts: 9
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Smoke »

"Before arguing for matrices please take a look at our code and see if that is even applicable. Same for zooming..."

I don't need to see your code to make this determination.

It's a basic and fundamental aspect of rendering that applies to every single graphics API that I've ever used, and imagine has ever existed.

As for practical advice, it was already given, you've simply refused to hear it.

Anyways, I suggest researching basic rendering principles, particularly matrices, and their usage in terms of transformations. (ie, rotation, etc,.)
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

Enough arguing about it, if you want to really help, please first look at the code and give practical advice instead of theoretical.
As long as you have no idea about SDL or our code all you are giving is useless theoretical advice and wisecracking.
Wouldn't you look foolish to begin with if we were already using matices?
Or if we weren't would you volunteer to rewrite our rendering code to use them, testing the whole game that your new code doesn't break anything?
I guess not as you only like to give theoretical advice. Thanks but no thanks.

If you like to discuss this further, please start your own thread but be gone from this one. I'll see to it that this thread keeps clean from now on.

Edit: seriously, reread what I wrote. NO MORE of this in this thread. I WILL keep this thread clean from now on.
If you open a new thread be aware that in theory world peace could be achieved by killing all humans. But that is just not practical. Applying this to your matrix stuff. Yes, in theory matrices would help, it's just not practical to rewrite everything at this stage. You are welcome to hand in patches - that would be practical. Theories are nice I'd just like you to prove it. Until then consider yourself ignored (unless it really concerns the topic of this thread again). Also see https://dl.dropbox.com/u/29229104/picdu ... erenet.jpg
--
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!
Ugh...

Re: Rotate graphics 45 degrees to be upright?

Post by Ugh... »

No matter how many times I repeat all steps and double-check each one, I can't get the rotation to work. And I know that Exult-rotate-v2.exe is loading the right keys file, as if I erase one of the default key bindings from the same file I added the key for toggle_rotate_world to, it stops working in-game. WTF?
Mimu

Re: Rotate graphics 45 degrees to be upright?

Post by Mimu »

Hmm. If you try editing your video settings in-game, and switch the scaler to something other than 2xSaI, then close the menu and press Q, there should be a message saying "Rotate: needs 2xSaI scaler". If you don't get that message, then I would guess maybe the Q keybinding isn't working for whatever reason... :?
cma

Re: Rotate graphics 45 degrees to be upright?

Post by cma »

Responding to Kalos Dragon's post

"There are issues with:

-Mouse alignment with object about to be dragged
-Object being dragged reverts to the original, non-rotated display."

Mouse alignment turn out to be a tough problem. Mouse positions are rotated for finding object in rotated world. I cannot make the mouse works well with all the objects on screen. objects close to the center of the screen seems to align better. I did some adjustments anyway, try this windows executable and see whether the alignment improved.
https://www.dropbox.com/s/etua8zt990ybm ... te-0.3.exe

To rotate the object being dragged it need to be upscale first otherwise the graphics will look crappy. Unfortunately, dragged objects is painted on top of the gump (to support dragging object to character inventory) which does not upscale until all the non-rotate shape are all painted. This require quite a bit of code changes. I need to give it some more thought.
Guesto

Re: Rotate graphics 45 degrees to be upright?

Post by Guesto »

Looks awesome, keep it up
TDI

Re: Rotate graphics 45 degrees to be upright?

Post by TDI »

Awesome. I can't wait for this to make it's way into the official snapshots. Then it will really be time to replay U7 again.
voskat

Re: Rotate graphics 45 degrees to be upright?

Post by voskat »

This doesn't work with Exult 1.5.0 then?
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

No, it doesn't work with SVN.
--
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!
Elrond Hubbard

Re: Rotate graphics 45 degrees to be upright?

Post by Elrond Hubbard »

Sometimes people ask "Why do we need Exult, can't you just run Ultima 7 in Dosbox?"

Exult Rotate is an example of something you can only do with an open-source reimplementation of the Ultima 7 engine.
Kalos Dragon

Re: Rotate graphics 45 degrees to be upright?

Post by Kalos Dragon »

So, what's going on with this? Any News?
Kalos Dragon

Re: Rotate graphics 45 degrees to be upright?

Post by Kalos Dragon »

Really? Nothing?

Thou surely must be kidding!
paulo

Re: Rotate graphics 45 degrees to be upright?

Post by paulo »

There are lots of other things happening with exult right now, but this patch is not one of them, unless there is a surprise merge request.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

Someone would need to take a look how cleanly it merges AND fix the dependency on a certain scaler.
--
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!
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by marzo »

I got some time after I fix the blacksmith schedule, so I may take a look at those points. Is there a patch available for v3? I only see the exe for it, and patches and exes for v2.
------
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]
cma

Re: Rotate graphics 45 degrees to be upright?

Post by cma »

@Kalos Dragon: sorry for my absent of response. I started looking at the dragging shape not being rotated issue after new year's day. I think i may have a workaround , still trying get the code working.

@Geometrodynamic Dragon: I did not post the v0.3 patch, there wasn;t much change from v2 anyway. Let me try merge this patch with 1.5 CVS snapshot source. Hopefully I can create a 1.5.x patch sooner. I never work with the CVS source before, so I have no idea when the patch will be ready.
cma

Re: Rotate graphics 45 degrees to be upright?

Post by cma »

Here is a patch against Excult 1.5 SVN snapshot.

https://www.dropbox.com/s/kancv33s31x85 ... v0.3.patch

It should work the same as the old 1.4.9-rc9-rotate-v0.3.patch except I enabled a few more scalers. The following scalers should work, finger crossed :)

- Point (2x, 3x , etc),
- Scale2x
- 2xSaI, Super 2xSaI
- Super Eagle
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

Thanks a lot.
I had some errors applying the patch:
in gamewin.h
#include "objs/flags.h"
#include "shapes/vgafile.h"
This wasn't a problem before because gamewin.h wasn't included in imagewin.cc before.
(most likely the imagewin/makefile.am just needs "-I$(srcdir)/../shapes -I$(srcdir)/../objs" to AM_CPPFLAGS)

Then this:

Code: Select all

drag.cc:233:9: error: no matching member function for call to 'paint'
                gwin->paint(gwin->clip_to_win(rrect));
                ~~~~~~^~~~~
./gamewin.h:446:7: note: candidate function not viable: no known conversion from
      'Rectangle' to 'Rectangle &' for 1st argument;
        void paint(Rectangle& r)
             ^
./gamewin.h:445:7: note: candidate function not viable: requires 4 arguments,
      but 1 was provided
        void paint(int x, int y, int w, int h);
             ^
./gamewin.h:448:7: note: candidate function not viable: requires 0 arguments,
      but 1 was provided
        void paint();                   // Paint whole image.
             ^
1 error generated.
I "resolved" this by replacing
gwin->paint(gwin->clip_to_win(rrect));
with just
gwin->clip_to_win(rrect);
which is probably wrong though...

I made a snapshot for OS X with this patch and the rotate key 'Q' already assigned. http://dl.dropbox.com/u/7737184/Exult-snapshot.dmg

Strangeness I found:
- when you drag an object, the object is still left painted at its original point until you let go of the object at its new point (could very well be related to my "fix" above)
- teleport cheat alt+t is not using the new rotated coordinates
--
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!
cma

Re: Rotate graphics 45 degrees to be upright?

Post by cma »

Try change this:
gwin->paint(gwin->clip_to_win(rrect));
to:
Rectangle crect = gwin->clip_to_win(rrect);
gwin->paint(crect);
insteads and see whether it helps.

For the Alt-t cheat. look inside cheat.cc and add new code after the call to screen_to_game

void Cheat::cursor_teleport (void) const {
if (!enabled) return;

int x, y;
SDL_GetMouseState(&x, &y);
gwin->get_win()->screen_to_game(x,y,gwin->get_fastmouse(),x,y);
(new) if (gwin->rotate) gwin->map_to_rotated_map(x,y); // convert to rotated world

I did not try the cheat keys so assume they do not (yet) work for rotated world. I will update the v0.3 patch to include above changes.
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 didn't try anything new out except for getting your last v3 patch and with that all my problems (except for the makefile.am one) are solved.
No compile problem, no dragging ghost on original spot and teleport cheat worked fine, too.

Thanks a lot.
Same snapshot for OS X at http://dl.dropbox.com/u/7737184/Exult-snapshot.dmg (still uploading, though) :)
--
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!
Kalos Dragon

Re: Rotate graphics 45 degrees to be upright?

Post by Kalos Dragon »

Well ain't that a thing.
Is this truly to be merged into the main project?

It shows that there's still plenty of room for innovation in this old game.

Have a beer on me.
Maenad

Re: Rotate graphics 45 degrees to be upright?

Post by Maenad »

This looks absolutely amazing, but I appear to be screwing something up.

I have the exult-1.5-rotate-v0.3.patch file in the patch folder.
I've set the location to the folder it's in.
I've directed to my_keys and added the Q toggle_rotate_world line.
The cfg file I'm using is in appdata\local.
I'm using the Exult 1.5.x binary Snapshot for Windows (I'm running 64 bit Win7).

Nothing happens when I press Q. What am I missing?


Long version of file locations for reference:
C:\Users\Me\AppData\Local\Exult\exult.cfg now has:

C:\UC\Ultima7\patch


C:\Users\Me\Desktop\Games\Exult\my_keys.txt


and C:\Users\Me\Desktop\Games\Exult\my_keys now has:
Q toggle_rotate_world
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

You use the exe instead of the exult.exe. The patch file is for compiling exult with the changes in the patch, NOT for using it as a mod/patch
--
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!
Maenad

Re: Rotate graphics 45 degrees to be upright?

Post by Maenad »

Thanks. I thought that might be the case, but the .exe didn't work for me so I was trying everything.

Running the Exult-rotate-0.3.exe file instead of exult.exe (with it in the same folder) just gives me the message that it's not compatible with my version of windows, and to check whether I need a 32 or 64 bit version.

I tried it with both the 1.5 and the 1.4.9 snapshots just in case it worked with one and not the other, but got the same error.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

Ah, the v3 compiled version of this patch is for the 1.4.9 rc1 version of Exult.
(And the v3 PATCH file is actually for the source code of the snapshot ;))
--
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!
Maenad

Re: Rotate graphics 45 degrees to be upright?

Post by Maenad »

As a last ditch effort, I just uninstalled and reinstalled, and now it works. Thanks, and sorry to be a bother!

P.S. This is excellent.
Demorde

Re: Rotate graphics 45 degrees to be upright?

Post by Demorde »

I am attempting to apply the .3 patch to the current svn build (from the downloads page) on Arch Linux 64, but it will not successfully apply. As you can see from the output ( http://pastebin.com/raw.php?i=JCQshAWz ) there are a number of hunks that fail and I am not really qualified to fiddle with it to get it to apply correctly.

Any suggestions?
Moorkh
Posts: 4
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Moorkh »

I believe I have a similar problem as stated. I have installed the 1.49rc1 version of exult and have downloaded the 0.3 version (non-1.5) of this mod.
I have not used any patch as I don't think I need to, this already being 0.3.
I have inserted the changes in "my_keys" and exult.cfg.

Yet, when I try to start exult-rotate, I get that error mistake about the version not being compatible to my version of windows (7 64bit) even though vanilla exult works just fine. Any ideas?
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

Similar problem to which post?
--
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!
Moorkh
Posts: 4
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Moorkh »

To Maenad's. Concerning the error I get when starting exult-rotate-03.exe.
Re-installing didn't do anything for me, though, and I had installed exult freshly in the first place.
lexicon

Re: Rotate graphics 45 degrees to be upright?

Post by lexicon »

For me, 'exult-1.5-rotate-v0.3.patch' is not working properly
So I just use exult 1.49rc1 and 0.3. This works fine.

All you need is

Get exult 1.49rc1 and rotate 0.3
Edit exult.cfg and .txt
Start game with Exult-rotate-0.3.exe

And turn on your 'cheat' option in exult (in game)

Then press the proper key 'q'
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

Moorkh, redownload v3, perhaps that download was incomplete.
--
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!
Moorkh
Posts: 4
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Moorkh »

Redownloading helped some, thanks - the game now loads.

However, pressing Q still doesn't do anything. I checked that all my paths are correct, and the line in my_keys.txt is exactly as supposed to. Still nothing. There's something about modifying the "correct" exult.cfg, but I didn't quite catch that.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rotate graphics 45 degrees to be upright?

Post by Dominus »

Great that it now runs at least :)
see http://exult.info/faq.php#where_cfg for the right cfg to edit
--
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!
Torgus Dragon

Re: Rotate graphics 45 degrees to be upright?

Post by Torgus Dragon »

Just to be clear the game is not easily completeable with this mod correct?
Locked