Jump to content

San Andreas Moon and Rotor Blades fix for PC?


one2fwee4

Recommended Posts

Does anyone know of any mods that fix the PC version of san andreas to be like the PS2 version, to add:

 

A moon that cycles in phases depending on the day, instead of being "full" all the time.

 

 

Rotor blades and propellers that have the proper blurring effect so that they actually look decent.

 

 

Proper lighting from the sun to improve the atmosphere, like in the PS2 version.

 

 

Lights reflecting on the ground and on cars like in the PS2 version - cop car sirens, cars reflected in puddles etc.

 

 

 

 

If anyone knows this would be really helpful as it seems sad that that pc version is missing in these ways.

 

I saw a mod that added lots of things from the PS2 version but from what i could read it didn't mention any of these things as far as i could understand.

 

Thanks!

Link to comment
Share on other sites

Lights reflecting on the ground and on cars like in the PS2 version - cop car sirens, cars reflected in puddles etc.

http://www.gtagarage.com/mods/show.php?id=22398

Link to comment
Share on other sites

Cool thanks!

 

Does anyone know anything about the other fixes?

(Rotor blades, Orange sun glow / lens flare, weather effects and moon phases)?

 

It's sad that since gta2, pc has basically been shunned by rockstar. You would have thought they would have bothered to port these important parts of atmosphere :/

Link to comment
Share on other sites

Rotor blades - might as well be based on code written from scratch as they're bloody hard to trace down to whatever rendering bug is causing them to not show, and will be even harder to modify it to work.

 

Orange sun glow, lens flare, weather effects - seems to have been done a thousand times through timecyc.dat mods anyway.

A lens flare script was posted recently by DK22, I believe.

 

Moon phases - I did it briefly (and using a pretty cheap method) for Vigilante Justice, but someone else did it better. Not sure if they're releasing it as it is, though.

 

PC hasn't been "shunned" by R*, but to us modders they're infamous for leaving bugs in. The console versions also have bugs, but people only notice what was working in the console version and stops working in the PC port, not the things that were never implemented properly, of which there are many.

Link to comment
Share on other sites

More specifically, rotorblades were removed ON PURPOSE due to a possible D3D9 RW issue, or some implementation oddities R* could not have addressed.

 

Most likely same goes for strong sun effect which seems to be cut.

 

Moonphases are NOT cut (except of Steam version) but again, bugged and unworking :p

Edited by Silent
Link to comment
Share on other sites

IMFX contains moonphases.

Link to comment
Share on other sites

By "bugged and unworking" do you mean that it would have worked with really old drivers and graphics cards, or that it never worked but the code / content for it was still in the game and just required fixing?

 

 

So from what you lot seem to be saying, rotor blades and strong sun can't be added but there are mods for the rest of it?

 

Or could it be fixed it's just that no one has managed to?

I'm not really up to speed with the capabilities of 3d era GTA modding but i did hear people have been compiling fixes with a renderware sdk or something, which implies to be that it might be possible to code those things in but i could be being naive?

 

Sorry, i'm more aware of the 2d gta modding, i never really go into the 3d stuff and anyway it's been a lonnnng time!

 

Thanks for your help.

Link to comment
Share on other sites

By "bugged and unworking" do you mean that it would have worked with really old drivers and graphics cards, or that it never worked but the code / content for it was still in the game and just required fixing?

 

 

So from what you lot seem to be saying, rotor blades and strong sun can't be added but there are mods for the rest of it?

 

Or could it be fixed it's just that no one has managed to?

I'm not really up to speed with the capabilities of 3d era GTA modding but i did hear people have been compiling fixes with a renderware sdk or something, which implies to be that it might be possible to code those things in but i could be being naive?

 

Sorry, i'm more aware of the 2d gta modding, i never really go into the 3d stuff and anyway it's been a lonnnng time!

 

Thanks for your help.

 

It's not about fixing, but re-creating. If it were originally fixable, R* probably could have handled it. Unfortunately, with a graphics engine as old as RenderWare, is limited to the kind of graphics technology available around the time SA was created. To make it look good would require a programmer VERY good with graphics rendering. All those kinds are making their own game engines.

 

Basically, it's all about lighting. Everyone wants better lighting. It's also, like, the hardest thing to get right in a graphics engine :p

Link to comment
Share on other sites

I wonder why they cut the blurred rotors. They were in III and VC. However on both those games, at some points they have a major alpha bug. Rockstar may of removed them because they thought non blurred rotors would be better than the blurred ones with an alpha bug. But they were also cut on the Xbox version.

 

It isn't all that of a complex thing. I'm sure if someone tried, they could make their own code to re blur the rotors. I mean, we can do so much with modding the game, so it would seem silly if we can't find a way to do something as simple as blurring a rotor.

 

Two ideas that come to mind.

1. We can enable and disable parts on cars (hence how the mod garages work. Perhaps a script that swaps between a normal rotor and a blurred one depending on the situation.

2. If it isn't possible to do that, here is an idea that may be a little more noobish, but may be an alternative if 1 doesn't work. Simply have a duplicate of all the vehicles with rotors in the game. When the rotor is supposed to be blurred, it swaps to the one thats blurred, and when its supposed to be normal, it swaps to the one that is normal.

Both of these ideas are possibilities, but you won't have the gradual transformation between blurred and normal. If option 1 is possible, it might be possible to change the transparency of the blade.

 

By the way, I could of swore I saw a custom made heli that kinda had blurred rotors. Though the blades screwed up with ENB Series reflections as the blur had a reflection.

Link to comment
Share on other sites

It isn't all that of a complex thing. I'm sure if someone tried, they could make their own code to re blur the rotors. I mean, we can do so much with modding the game, so it would seem silly if we can't find a way to do something as simple as blurring a rotor.

 

cool! when r u go to release it????!!!!! :):):)

Link to comment
Share on other sites

Well if someone knows about editing then i have an idea for it based on what nkjellman said.

 

Like he says, the first option seems best by far.

 

I'm not sure how the playstation does it but i heard the "blur" effect alpha differs depending on the rotor speed.

 

If that is they case, then that is simply a case of tying the Alpha value of the blurred rotor part to the speed that the rotor is going round.

 

So, all the vehicles basically have 2 copies of each rotor - normal and blurred.

The blurred rotor should take precedence over the normal rotor, being seen infront of it, when both are visible (so maybe 2 copies of it, 1 above the rotor, one below).

 

When the rotor is stopped, or going slowly, the blurred rotor alpha is 0

When a certain threshold is reached, the rotor alpha is incremented along with the rotor speed (so for example, 0.1, 0.35 etc etc), until it reaches another max threshold where it is fully visible, so set to 1.

 

As i say, I don't really know how things are set up in these gta games or about gta modding so this might not be possible or work, but hopefully it will give someone that knows an idea.

Certainly if someone knows how they work in the PS2 version that would be helpful.

 

I thought that in 3 and vice city they are different in that in those versions, the rotors are always just a texture over a plane where as in SA, they are actual 3d models. I suppose in the PS2 version, the blurred rotor texture may still be a texture over a plane over the top of the 3d rotor. If so i would guess it would behave like i have suggested above.

 

 

Hopefully this helps someone!

 

Thanks

Link to comment
Share on other sites

The problem is that this method simply doesn't work on the RenderWare from the SA PC version, the rotor blade won't be blurred as expected.

Edited by LINK/2012
Link to comment
Share on other sites

The problem is that this method simply doesn't work on the RenderWare from the SA PC version, the rotor blade won't be blurred as expected.

 

They seem to think we could achieve the same effect by changing to a 'blurry texture' (which I doubt those solid black rotor blades even have and if they do - how would you make it look blurry?). They have a lot of faith in us executing their ideas.

Link to comment
Share on other sites

I was only trying to help with suggestions, there's no need to make bitchy, divisive comments :/

Of course i don't expect you to do it, i said nothing of the sort.

 

You didn't explain to me the specifics of the problem so i don't understand why what i said wouldn't work - you only mentioned problems with lighting in the RW engine. Nothing about alpha transparency. Alpha must work or trees wouldn't work.

However maybe you are saying that variable alpha transparency doesn't work, rather than just simply "fully transparent" or "fully visible".

 

So i'm sorry to upset you, but i did warn you i know nothing about 3d gta modding.

Link to comment
Share on other sites

I was only trying to help with suggestions, there's no need to make bitchy, divisive comments :/

Of course i don't expect you to do it, i said nothing of the sort.

 

You didn't explain to me the specifics of the problem so i don't understand why what i said wouldn't work - you only mentioned problems with lighting in the RW engine. Nothing about alpha transparency. Alpha must work or trees wouldn't work.

However maybe you are saying that variable alpha transparency doesn't work, rather than just simply "fully transparent" or "fully visible".

 

So i'm sorry to upset you, but i did warn you i know nothing about 3d gta modding.

 

I actually thought your last post was someone else, as it seemed pretty similar to the post above it. But at least you already admitted you don't know what you're talking about :p

 

Anyway, I thought we all made it pretty clear how none of what hasn't been done is as simple as it sounds. Not even the stuff that has been done would have been simple, but it's not due to such a low limit on our imaginations that an explanation of what could be made to look like something that the rest hasn't been done. No matter how clear a picture is painted in our minds, it doesn't help where it really matters, which is in the substantial complexities of hacking something into graphics rendering, especially when the part that was used to do it was completely removed.

 

Again, it's not really about modding here, but creating something entirely new, which even the programmers of the game and those of the engine didn't manage to do right :p

 

I wasn't upset. I use sarcasm rather liberally.

Edited by Deji
Link to comment
Share on other sites

I wonder why they cut the blurred rotors. They were in III and VC. However on both those games, at some points they have a major alpha bug. Rockstar may of removed them because they thought non blurred rotors would be better than the blurred ones with an alpha bug. But they were also cut on the Xbox version.

 

It isn't all that of a complex thing. I'm sure if someone tried, they could make their own code to re blur the rotors. I mean, we can do so much with modding the game, so it would seem silly if we can't find a way to do something as simple as blurring a rotor.

 

Two ideas that come to mind.

1. We can enable and disable parts on cars (hence how the mod garages work. Perhaps a script that swaps between a normal rotor and a blurred one depending on the situation.

2. If it isn't possible to do that, here is an idea that may be a little more noobish, but may be an alternative if 1 doesn't work. Simply have a duplicate of all the vehicles with rotors in the game. When the rotor is supposed to be blurred, it swaps to the one thats blurred, and when its supposed to be normal, it swaps to the one that is normal.

Both of these ideas are possibilities, but you won't have the gradual transformation between blurred and normal. If option 1 is possible, it might be possible to change the transparency of the blade.

 

By the way, I could of swore I saw a custom made heli that kinda had blurred rotors. Though the blades screwed up with ENB Series reflections as the blur had a reflection.

The rotors did not blur in GTA III.They are just rotating.Since the chopper does not "stop" at places,it was not needed to make un-blurred rotors.

Link to comment
Share on other sites

Many modders tried to figure out the blurred rotors thingy and hit a possible RW issue, that's why Deji might have seemed annoyed. I'd do too, as I attempted to tackle it like... four times throughout the years?

Link to comment
Share on other sites

I call my last post bullsh*t now. All credits go to .

 

 

http://youtu.be/a2vAhK_Ocj4

Link to comment
Share on other sites

Nowadays, any unresolvable graphic glitch let people blaming the RenderWare engine. I managed to get rid of the awful rotor blurring effect by myself months ago. This code does not fix it perfectly but it leads to a satisfactory result:

 

 

 

#define WIN32_LEAN_AND_MEAN#include <windows.h>#include <stddef.h>#include <string.h>enum RwRenderState{	rwRENDERSTATEZWRITEENABLE			= 8,	rwRENDERSTATEVERTEXALPHAENABLE		= 12,	rwRENDERSTATEALPHATESTFUNCTION		= 29,	rwRENDERSTATEALPHATESTFUNCTIONREF};enum RwAlphaTestFunction{	rwALPHATESTFUNCTIONLESS				= 2,	rwALPHATESTFUNCTIONEQUAL,	rwALPHATESTFUNCTIONGREATER			= 5};typedef bool (*RwRenderStateSetFunction)(RwRenderState state, void *param);struct RwDevice{	char _align0[0x10];	RwRenderStateSetFunction fpRenderStateSet;};struct RwGlobals{	char _align0[0x10];	RwDevice dOpenDevice;};struct RwFrame;struct RwObject{	int _align0;	RwFrame *parent;};struct RwObjectHasFrame{	RwObject object;};struct RpAtomic{	RwObjectHasFrame object;};class CAutomobile{public:	char _align0[0x0648];	RwFrame *m_aFrames[25];};template<class info_t>class CLink{public:	info_t m_info;	CLink<info_t> *m_pNext;	CLink<info_t> *m_pPrev;};template<class info_t>class CLinkList{public:	CLink<info_t> m_head;	CLink<info_t> m_tail;	CLink<info_t> m_freeListHead;	CLink<info_t> m_freeListTail;	CLink<info_t> m_freeList;};char *(__cdecl *const GetFrameNodeName)(RwFrame *pFrame) = (decltype(GetFrameNodeName))0x0072FB30;RwGlobals **const RwEngineInstance = (RwGlobals **)0x00C97B24;#define RwRenderStateSet(state, param)	(*RwEngineInstance)->dOpenDevice.fpRenderStateSet(state, (void *)param);class CVisibilityPlugins{public:	struct AlphaObjectInfo	{		typedef RpAtomic *(*callback_t)(RpAtomic *pAtomic, float depth);		RpAtomic *m_pAtomic;		callback_t m_pCallback;		float depth;	};	static CLinkList<AlphaObjectInfo> *const m_alphaList;	static inline void __cdecl RenderOrderedList(CLinkList<AlphaObjectInfo> &list)	{		char *nodeName;		for(CLink<AlphaObjectInfo> *entry = list.m_tail.m_pNext; entry != &list.m_head; entry = entry->m_pNext)		{			nodeName = GetFrameNodeName(entry->m_info.m_pAtomic->object.object.parent);			//if(!strcmp(nodeName, "moving_rotor") || !strcmp(nodeName, "moving_rotor2"))			if(!strncmp(nodeName, "moving_rotor", 12) && (nodeName[12] == '\0' || (nodeName[12] == '2' && nodeName[13] == '\0')))			{				{					RwRenderStateSet(rwRENDERSTATEALPHATESTFUNCTION, rwALPHATESTFUNCTIONEQUAL);					RwRenderStateSet(rwRENDERSTATEALPHATESTFUNCTIONREF, 255);					entry->m_info.m_pCallback(entry->m_info.m_pAtomic, entry->m_info.depth);					RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, false);					RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, true);					RwRenderStateSet(rwRENDERSTATEALPHATESTFUNCTION, rwALPHATESTFUNCTIONLESS);					entry->m_info.m_pCallback(entry->m_info.m_pAtomic, entry->m_info.depth);					RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, true);					RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, false);					RwRenderStateSet(rwRENDERSTATEALPHATESTFUNCTION, rwALPHATESTFUNCTIONGREATER);					RwRenderStateSet(rwRENDERSTATEALPHATESTFUNCTIONREF, 100);				}				// This works for any flat blur available in all GTA 3 series except SA.				/*{					RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, false);					RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, true);					RwRenderStateSet(rwRENDERSTATEALPHATESTFUNCTIONREF, 0);					entry->m_info.m_pCallback(entry->m_info.m_pAtomic, entry->m_info.depth);					RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, true);					RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, false);					RwRenderStateSet(rwRENDERSTATEALPHATESTFUNCTIONREF, 100);				}*/			}			else			{				entry->m_info.m_pCallback(entry->m_info.m_pAtomic, entry->m_info.depth);			}		}	}	static void __cdecl RenderAlphaAtomics()	{		RenderOrderedList(*m_alphaList);	}};typedef CLinkList<CVisibilityPlugins::AlphaObjectInfo> alphaObjectLink_t;alphaObjectLink_t *const CVisibilityPlugins::m_alphaList = (alphaObjectLink_t *)0x00C88070;void WINAPI InstallHookOff(LPVOID lpAddress, LPVOID lpLocation){	DWORD dwProtect[2];	VirtualProtect(lpAddress, 4, PAGE_EXECUTE_READWRITE, &dwProtect[0]);	*(DWORD *)lpAddress = (DWORD)lpLocation - ((DWORD)lpAddress + 0x04);	VirtualProtect(lpAddress, 4, dwProtect[0], &dwProtect[1]);}template<class value_t>void WINAPI WriteProtectedMemory(LPVOID lpAddress, value_t value){	DWORD dwProtect[2];	VirtualProtect(lpAddress, sizeof(value_t), PAGE_EXECUTE_READWRITE, &dwProtect[0]);	*(value_t *)lpAddress = value;	VirtualProtect(lpAddress, sizeof(value_t), dwProtect[0], &dwProtect[1]);}void InstallAllHooks(){	InstallHookOff((LPVOID)0x00553319, (LPVOID)CVisibilityPlugins::RenderAlphaAtomics);	//WriteProtectedMemory<int>((LPVOID)0x6C444D, offsetof(CAutomobile, m_aFrames[13]));	//WriteProtectedMemory<int>((LPVOID)0x6C4486, offsetof(CAutomobile, m_aFrames[15]));	//WriteProtectedMemory<int>((LPVOID)0x6C44BD, offsetof(CAutomobile, m_aFrames[12]));	//WriteProtectedMemory<int>((LPVOID)0x6C44F0, offsetof(CAutomobile, m_aFrames[14]));}BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReasonForCall, LPVOID lpReserved){	if(dwReasonForCall == DLL_PROCESS_ATTACH)	{		InstallAllHooks();	}	return TRUE;}

 

Needless to say, it is the umpteenth side effect of the notorious alpha blending bug. The Criterion's engine has nothing to do with it as usual, it's the "wrong" way R* programmers organized the rendering code. Achieving a correct alpha blending implies to use a two-passes rendering technique and therefore:

  • Render all of the opaque objects or at least their fully opaque pixels (set rwRENDERSTATEALPHATESTFUNCTION to rwALPHATESTFUNCTIONEQUAL and rwRENDERSTATEALPHATESTFUNCTIONREF to 255) by enabling rwRENDERSTATEZTESTENABLE and rwRENDERSTATEZWRITEENABLE with rwRENDERSTATEVERTEXALPHAENABLE disabled;
  • Sort all of the translucent objects and render them from back to front (from the farthest to the closest) or at least their translucent pixels (set rwRENDERSTATEALPHATESTFUNCTION to rwSTENCILFUNCTIONLESS) by enabling rwRENDERSTATEVERTEXALPHAENABLE and disabling rwRENDERSTATEZWRITEENABLE.
I took the cue from this article which examines the theme in depth. Unfortunately, shadows are not casted on translucent objects when rwRENDERSTATEZWRITEENABLE is disabled and so a third pass is necessary. To make it cheap, we can just render the depth of the meshes whose material requires rwRENDERSTATEVERTEXALPHAENABLE to be enabled. I believe, everything can be done without altering the atomic pipelines individually, we could hook AtomicDefaultRenderCallBack (0x7491C0) and execute the object pipeline three times, one for each step.

 

Personally, I injected my own function for rendering the vehicle-alpha-atomics and the first substantial benefit I noticed was the Hydra cockpit no more disappeared when I rotated the camera on the right side. The code is a mess at present, so I wouldn't like to show it.

 

Any corrections or denials of what I said are appreciated. I'm not quite good at the computer graphic subject. :p

 

EDIT: Years later I realised Thomas the Tank Engine was written in place of Hydra. :)

Edited by Wesser
Link to comment
Share on other sites

Nowadays, any unresolvable graphic glitch let people blaming the RenderWare engine. I managed to get rid of the awful rotor blurring effect by myself months ago. This code does not fix it perfectly but it leads to a satisfactory result:

"months ago"

 

...this is one of THE most requested fixes people bring up for San Andreas as wanting to be fixed, and you've been sat on it for months? You could have like, told people, or let people know in the other threads asking about this. _DK brought up the idea for this method just the other day and got a quick work around to try which appeared to be working, so sorry dude, but I'm giving credit to him on this.

Link to comment
Share on other sites

Nowadays, any unresolvable graphic glitch let people blaming the RenderWare engine.

Since SA is maybe the most complex game to run under d3d9 RW it did have a point imho. But seeing how rotorblades got fixed by setting alphafunctionref to 0, it indeed seems that RW is fine and R* just can't use it :p

 

Same goes for DOUBLE_RWHEELS bug, they literally forgot to call RwMatrixUpdate on the children wheels.

Link to comment
Share on other sites

Well a great deal of us didn't take the time to re-look into the problem with the great aid of the GTA SA Mobile IDB, which allows a much easier navigation of the rendering functions. So it is definitely something which probably wouldn't have been achieved before its release. _DK has gained a great understanding of the RenderWare engine as is evident with his mods over the past couple years. Timing helps greatly, though.

 

But then, to re-answer the original question, yes, pretty much everything you're asking for has been done :p

Edited by Deji
Link to comment
Share on other sites

@Ash_735, who's seeking the authorship of such fix? I just showed the code of a more reliable way of fixing the bug, since no one has ever done it. Speaking of the reason why I didn't post it before, it's because I've been finding a way to solve the alpha blending bug in order to takle the roots of the problem without fixing any of its issues singularly. As someone got his own working solution, I committed myself to publish mine. That's it. :p

 

@Silent, continuing from our personal conversation, those "extra" RwRenderStateSet lines where put on purpose. Take a comparison screenshot:

 

a0gn5c.jpg

 

EDIT: Oh, I updated the code to make it fully compatible with SA original blurred rotors (which are partly "solid").

Edited by Wesser
Link to comment
Share on other sites

EDIT: Oh, I updated the code to make it fully compatible with SA original blurred rotors (which are partly "solid").

 

I tried compiling this code into a DLL and renaming it to an ASI file (no errors during compile), but no difference in-game. I used Silent's ASI Loader.

 

Or maybe I'm just misinterpreting what this is for?

Link to comment
Share on other sites

That code does not implement the fading-blur effect which has been completely cut from the final release (pretty easy to do though, just copy'n'paste the original VC code or replicate what's useful), but it fixes the way the game process the alpha blending onto the translucent pixels.

Link to comment
Share on other sites

El Dorado

wait what, alpha bug is fixed?

Link to comment
Share on other sites

 

Nowadays, any unresolvable graphic glitch let people blaming the RenderWare engine.

Since SA is maybe the most complex game to run under d3d9 RW it did have a point imho. But seeing how rotorblades got fixed by setting alphafunctionref to 0, it indeed seems that RW is fine and R* just can't use it :p

 

Same goes for DOUBLE_RWHEELS bug, they literally forgot to call RwMatrixUpdate on the children wheels.

 

Renderware does have some limitations, and makes a few assumptions where it shouldn't, but yea, the programmers have some responsibility as well. Rw does provide direct access to the d3d device if an effect that can't be done directly in Rw is desired.

 

About the (lack of) double rear wheels, is a fix available or doc'ed anywhere?

Edited by DexX
Link to comment
Share on other sites

About the (lack of) double rear wheels, is a fix available or doc'ed anywhere?

Gonna release it fairly soon in SilentPatch, it's very simple though. All it takes is calling RwMatrixUpdate in CVehicleModelInfo::PreprocessHierarchy on the newly created 'children' wheels' frames. They didn't do it in all versions of the game yet only D3D9 RW decided not to render those wheels :p

Edited by Silent
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.