Quantcast

Jump to content

» «
Photo

[PLUG|OS] Script Dependent Drawings

20 replies to this topic
Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci Racing
  • Joined: 19 Aug 2006
  • Unknown

#1

Posted 20 April 2013 - 05:50 PM Edited by Wesser, 25 April 2013 - 11:43 AM.

Script Dependent Drawings v1.15 Bug Fix
GTA San Andreas modification
Open source (Copyleft)

1. MODIFICATION OVERVIEW
    This GTA San Andreas modification has been planned mainly to answer the frequently asked question about solving the on-screen white squares bug. This "glitch" occurs because some scripts may share the same slots for the texture storage. Now, any script will load his own texture dictionary which will be allocated over the memory in an indipendent way as opposed to those of the others. The code has been optimized and designed to be as fast as the original one or even faster, in some circumstances, for each script processing.
2. INSTALLATION
    Unzip the content of the rel folder under the game directory by overwriting the files that match with those existing:

    • sddwg.asi;
    • stream.ini (not really needed, see below).
3. STREAM INI CONFIGURATION
    You are able to manipulate the amount of sprites that will be allocated at the game loading stage, by adding and/or modifying the following line to the stream.ini file:
    CODE
    sprites  128

    This value affects both rectangle and texture sprites but separately.
4. COMPATIBILITY
    Below are listed all game executable and CLEO library versions whereon the operation of this modification is fully certified:

    • Game executables:
      • gta_sa.exe v1.0 US (HOODLUM, 14.383.616b);
      • gta_sa.exe v1.0 EU (HOODLUM, 14.386.176b).
    • CLEO libraries:
      • cleo.asi v3.0.950 (Seemann);
      • cleo4.asi v4.1.1.30f (Alien).

    I would discourage the use of such library on any other game executable or CLEO version, otherwise unexpected crashes or glitches may occur.
5. DISCLAIMER
    Use this library at your own risk and be aware I won't be responsible for any damage provoked on your pc.
6. KNOWN BUGS
    In case there is any, they are unknown yet. Feel free to report them.
7. CHANGELOG HISTORY
  • 04/25/2013 (v1.15 Bug Fix):
    • Fixed a bug when rendering an amount of sprites higher than 127.
  • 04/23/2013 (v1.1 Bug Fix):
    • Fixed a bug with USE_TEXT_COMMANDS (03F0) flag, not thread dependent yet;
    • Fixed an issue when building the full path of a TXD file.
  • 04/20/2013 (v1.0):
    • The following commands have been altered:
      • (004E) TERMINATE_THIS_SCRIPT;
      • (038D) DRAW_SPRITE;
      • (038E) DRAW_RECT;
      • (038F) LOAD_SPRITE;
      • (0390) LOAD_TEXTURE_DICTIONARY;
      • (0391) REMOVE_TEXTURE_DICTIONARY;
      • (03E3) SET_SPRITES_DRAW_BEFORE_FADE;
      • (0459) TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME;
      • (074B) DRAW_SPRITE_WITH_FIXED_ROTATION;
      • (08A0) UNKNOWN_08A0;
      • (0937) DRAW_WINDOW;
      • (0A93) TERMINATE_THIS_CUSTOM_SCRIPT;
      • (0ABA) TERMINATE_ALL_CUSTOM_SCRIPTS_WITH_THIS_NAME.
    • Texture dictionaries are linked to those threads that load them;
    • Rectangle and texture sprites are arranged separately;
    • Rectangle sprites are stored globally by any script;
    • Texture sprites are allocated every time a texture dictionary is loaded in a thread and cannot be accessed by any other;
    • The linear filtering has been enabled on top drawings to fix a possible R* graphic fault, to prevent some of them from being pixelated. Perhaps, this is the reason of SET_SPRITES_TO_BE_DRAWN_ANTIALIASED definition in the early SCM modding times, as the wrongly-named command actually puts a specific sprite on top.
8. TO-DO LIST
  • Make USE_TEXT_COMMANDS flag thread dependent;
  • Make sure that LOAD_TEXTURE_DICTIONARY opens a texture from a given path;
  • Restore DRAW_WINDOW_TEXT (0938) command (definition needs confirmation);
  • Add the ability to load multiple texture dictionaries in a thread without necessarily removing by REMOVE_TEXTURE_DICTIONARY and reloading the previous again;
  • Hook text draw routines to manage their amount.
9. CREDITS
  • Contributers of gta_sa.idb, whose package is available publicly here;
  • ThirteenAG, for reporting most of the bugs.
Enjoy. Regards, Cajetan Lacazette (alias) aka Wesser.
  • Silent likes this

Frank.s
  • Frank.s

    AKA PingPang

  • Members
  • Joined: 15 Apr 2008
  • None

#2

Posted 20 April 2013 - 05:52 PM

Impressive, very useful to the SA modding scene. Great work. cookie.gif

damiann69
  • damiann69

    He he

  • Members
  • Joined: 01 Feb 2011
  • Poland

#3

Posted 20 April 2013 - 06:11 PM

I haven't occur this bug (yet ;] ), or maybe don't remember... In google nothing too smile.gif Could somebody upload some screen? Anyways, thanks for it. GTA SA modding scene is awesome.

aStiffSausage
  • aStiffSausage

    Formerly Oksu

  • Members
  • Joined: 30 Sep 2010
  • Finland

#4

Posted 20 April 2013 - 06:12 PM Edited by oksa8, 20 April 2013 - 06:15 PM.

Never really thought of something as helpful as this. Makes coding so much simpler when there's no need to check in every script if you have to reload the textures or not, and no more conflicting textures! (Black Market mod conflicting with Rain Drops mod for example, was quite hilarious to see leafs, lines of cocaine etc. scrolling through screen when raining. smile.gif )

EDIT:
@damiann69

For easy example, use a speedometer and Wesser's Windscreen HUD at the same time. When you leave the car, the speedometer releases the textures, but as scm-engine had some bugs, also the Windscreen HUD lost its textures, causing only white squares to be drawn on screen. This mod makes each txd-function to be separated, so such things won't happen anymore.

ThirteenAG
  • ThirteenAG

    Foot Soldier

  • Members
  • Joined: 29 Dec 2008
  • None

#5

Posted 20 April 2013 - 06:39 PM

Very nice, but i'm experiencing a crash after entering a car(1.0us/cleo3/a lot of plugins and mods):
CODE
GTA:SA Crashed, Debug Info Follows:


GTA Info:

Error: Unknown

Assembly Info:

Exception At Address: 0x007F3825
Exception Code: 0xc0000005 (EXCEPTION_ACCESS_VIOLATION)

Registers:
EAX: 0x4CF5D7D8 EBX: 0x00000001
ECX: 0x03349388 EDX: 0x00727270
ESI: 0x4CF5D7D8 EDI: 0x00000000
EBP: 0x0023F854 ESP: 0x0023F838

Last Opcode: 038F in thread 'speed' (0x355CC74)


speed source: http://pastebin.com/E4czkDn4

direstraits
  • direstraits

  • Members
  • Joined: 08 Mar 2011
  • Portugal

#6

Posted 21 April 2013 - 09:08 AM

I have the same problem as ThirteenAG, I think it's the speedometer.

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci Racing
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [GTA] 2013
    Most Helpful [Modding] 2013
    Most Talented [Modding] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Best Vehicle 2013 "III Aircraft"
    Most Helpful [Modding] 2012
    Modder of the Year 2012

#7

Posted 21 April 2013 - 09:16 AM

Hope that this time mod's compatible with compact EXE? tounge.gif

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009

#8

Posted 21 April 2013 - 10:28 AM

Good work, it's another plugin that's very useful.

LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci Racing
  • Joined: 30 Jan 2011
  • Brazil

#9

Posted 22 April 2013 - 12:11 AM

Really useful plugin

Sidoarjo_Modder
  • Sidoarjo_Modder

    *void*

  • Members
  • Joined: 27 May 2010
  • None

#10

Posted 22 April 2013 - 03:30 AM

finally, someone did it. what i fear, will not happen again. thanks Wesser, you're the man cool.gif

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci Racing
  • Joined: 19 Aug 2006
  • Unknown

#11

Posted 23 April 2013 - 05:43 PM Edited by Wesser, 23 April 2013 - 08:45 PM.

Thank you for all of your feedback, guys. I uploaded a fixed version in the hope that all bugs are gone. icon14.gif

QUOTE (SilentPL @ Sunday, Apr 21 2013, 10:16)
Hope that this time mod's compatible with compact EXE? tounge.gif

It should. I'm too lazy to test by myself. tounge.gif

ThirteenAG
  • ThirteenAG

    Foot Soldier

  • Members
  • Joined: 29 Dec 2008
  • None

#12

Posted 23 April 2013 - 06:28 PM

Looks like it's working fine now, but i still have a crash without 'sprites 128' line in stream.ini. I assumed 'not really needed' means what it means...

user posted image

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci Racing
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [GTA] 2013
    Most Helpful [Modding] 2013
    Most Talented [Modding] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Best Vehicle 2013 "III Aircraft"
    Most Helpful [Modding] 2012
    Modder of the Year 2012

#13

Posted 23 April 2013 - 06:39 PM

QUOTE (Wesser @ Tuesday, Apr 23 2013, 19:43)
Thank you for all of your feedback, guys. I updated a fixed version in the hope that all bugs are gone. icon14.gif

QUOTE (SilentPL @ Sunday, Apr 21 2013, 10:16)
Hope that this time mod's compatible with compact EXE? tounge.gif

It should. I'm to lazy to test by myself. tounge.gif

It will be, as long as you're not usng any hoodlum addresses or so (like you did in Full Nitro Control) icon14.gif

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci Racing
  • Joined: 19 Aug 2006
  • Unknown

#14

Posted 23 April 2013 - 09:02 PM

QUOTE (ThirteenAG @ Tuesday, Apr 23 2013, 19:28)
... i still have a crash without 'sprites 128' line in stream.ini. I assumed 'not really needed' means what it means...

Well, I meant that you don't have to necessarily overwrite the stream.ini file, because you can add that line even manually. tounge2.gif

QUOTE (SilentPL @ Tuesday, Apr 23 2013, 19:39)
It will be, as long as you're not usng any hoodlum addresses or so (like you did in Full Nitro Control)  icon14.gif

I think you mean HOODLUM specific addresses. Then, I don't know.

ThirteenAG
  • ThirteenAG

    Foot Soldier

  • Members
  • Joined: 29 Dec 2008
  • None

#15

Posted 25 April 2013 - 08:09 AM

I'm pretty sure i had a cursor before installing this plugin smile.gif
user posted image

src

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci Racing
  • Joined: 19 Aug 2006
  • Unknown

#16

Posted 25 April 2013 - 11:40 AM

Thank you for reporting another bug. icon14.gif

Modification updated.

direstraits
  • direstraits

  • Members
  • Joined: 08 Mar 2011
  • Portugal

#17

Posted 12 May 2013 - 11:00 AM

I found a bug, the weapon icon desapears when I'm using the jetpack.

acid96
  • acid96

    Player Hater

  • Members
  • Joined: 26 May 2013

#18

Posted 28 May 2013 - 10:45 AM Edited by acid96, 28 May 2013 - 01:14 PM.

Is there any way to get it working with SAMP, since SAMP loads own stream.ini



fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009

#19

Posted 22 September 2013 - 01:14 PM Edited by fastman92, 22 September 2013 - 01:15 PM.

The problem described below isn't caused by Script Dependent Drawings.
 
{$CLEO}
0390: load_txd_dictionary 'SPEEDO'
038F: load_texture "Bck" as 1 // Load dictionary with 0390 first

while true
wait 0
03F0: enable_text_draw 1
074B: draw_texture 1 position 320.0 224.0 scale 100.0 100.0 angle 180.0 color_RGBA 255 255 255 255
end
Did anyone notice a texture drawn with 074B opcode, with angle and drawn flipped horizontally as shown on picture?

554b85277501830.jpg

When scale becomes -100.0 100.0
it's good

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci Racing
  • Joined: 19 Aug 2006
  • Unknown

#20

Posted 22 September 2013 - 06:24 PM Edited by Wesser, 22 September 2013 - 06:24 PM.

I found a bug, the weapon icon desapears when I'm using the jetpack.

I don't get this bug on a clean game with such modification installed. I'm sorry, I cannot do anything.

 

Is there any way to get it working with SAMP, since SAMP loads own stream.ini

Somebody suggested to load settings from another file aswell. I'll see what I can do.

 

The problem described below isn't caused by Script Dependent Drawings...

I noticed this issue during my tests too and I ended up by keeping everything as it is. The main source is full of 074B commands drawing flipped textures. R* was probably aware about it, seems like it is intentional. Dunno why.


LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci Racing
  • Joined: 30 Jan 2011
  • Brazil

#21

Posted 11 January 2014 - 05:48 PM

Any news on unconflicting this with modloader?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users