Giter Club home page Giter Club logo

dev's Introduction

Sanny Builder

Sanny Builder is a fast and powerful tool designed for the GTA 3D game series. It includes a disassembler, permitting the end-user to transform the game scripts into text and a compiler to translate source code written in the custom language back into the binary form readable by the game. Sanny Builder also offers a convenient editor with a large number of useful functions such as syntax highlighting, error checking, advanced search tools, player coordinates reading, fast movement through code and much more.

Sanny Builder 4

This repository aims to collect users feedback and progress made by the development team.

Documentation

Detailed documentation on Sanny Builder features can be found here: https://docs.sannybuilder.com/

How can I help?

There are numerous ways of helping to develop the project. See the Contribution guide for more information.

License

Sanny Builder is licensed as a freeware software under the terms defined in the end-user agreement.

dev's People

Contributors

x87 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dev's Issues

Increased Screen Space for the Current Edit Mode

Currently, only 12 to 14 characters can be used before the game icon becomes obscured. The just isn't enough room to spell out Liberty City Stories (20). It's difficult to describe the edit mode, platform and version in the space allowed and use more than 2 to 3 characters for the game name.

Autocomplete list should display constants anywhere

  • currently constants are only displaying when the list is called on a standalone statement, not within an opcode. Contansts are applicable anywhere and therefore the list should get a general availability.

  • Constants defined in constants.txt are not included on the list.

  • another note: list of values for an "extended" param (enum) should not include functions (currently it does).

  • should display user-defined constants (const..end)

Decompiler Error "$11330(24@,1600i) = &0(25@,1i)"

Sanny reports an incorrect jump instruction when decompiling this command:
$11330(24@,1600i) = &0(25@,1i)
I was just trying to verify that Sanny was compiling with 0084 and had to check with a hex editor instead.

The command is being used to copy parts of PS2 memory to expanded variable space so I can hunt for offsets, and it compiles and works as expected. I was just surprised that the command wouldn't decompile and wanted to drop a note on the issue.

Feature: Function/Pointer syntax

In fact, it may not make sense to do so. But in theory, I hope that the sb tool can add more new OP writing methods. Essentially, I think we should add a new simple syntax to the frequently used basic OP and SA (CLEO4).VC.3 (CLEO2.0) OP

In fact, I got the idea from gosub:
gosub @xxxx
xxxx ()

But actually you should add highlighting to the above code

Back to the topic, I have an example:
0AA5: call 0x123456 num_params 3 pop 3 0@ 1@ 2@
Maybe this:
call 0x123456 (3 2@ 1@ 0@)
call 0x123456 3(2@ 1@ 0@)
By writing call address + (parameter), the SB tool can automatically detect the number of parameters (num_params) in () when compiling.
In fact (3 2@ 1@ 0@), the 3 in () should be the pop parameter. In fact, OP 0AA5 fills the parameters in CLEO upside down, which is very uncomfortable. 2@ should be the first parameter

More examples:
0AA5: call 0x123456 num_params 3 pop 3 0@ 1@ 2@
call 0x123456 (3 2@ 1@ 0@)

0AA6: call_method 0x123456 struct 30@ num_params 3 pop 3 0@ 1@ 2@
call 0x123456 30@(3 2@ 1@ 0@)

0AA7: call_function 0x123456 num_params 3 pop 3 0@ 1@ 2@ ret 3@
call 0x123456 (3 2@ 1@ 0@) ret 3@

0AA8: call_function_method 0x123456 struct 30@ num_params 3 pop 3 0@ 1@ 2@ ret 3@
call 0x123456 30@(3 2@ 1@ 0@) ret 3@

0AB1: call_scm_func @xxxx 3 0@ 1@ 2@ ret 3@ 4@ 5@
call xxxx (3 0@ 1@ 2@)ret 3@ 4@ 5@
:xxxx
0AB2: ret 3 3@ 4@ 5@
ret (3@ 4@ 5@)
ret 0 = ret

Just like the example, the sb tool automatically detects the number of parameters (). But the above code is still not good. Such as pop and struct parameters. Maybe it can be declared at the beginning:
var
this 30@
stdcall 0x654321
cdecl 0x123456
end

call 0x123456 (30@ 2@ 1@ 0@}
call 0x654321 (30@ 2@ 1@ 0@}

In the end I suggest this
call address + (parameter)
pop and struct can be declared at the beginning

Dark Theme

Explore a possibility to implement a dark theme for the IDE

Full IDE Support in Cleo Scripts

Can the decompilation process for cleo scripts be modified so that any object ID that can be compiled can also be decompiled to the same ID rather than the object number.

In SCM the object IDs are defined by the SCM header and decompile as expected. IIRC, used to be that only some IDs could be used in cleo scripts, but somewhere along the line Sanny was able to work with an extended IDE set. This extended support is missing from the sa_mobile mode which only includes 4 basic IDE files. I figure that these are the files with model IDs that always compile to their ID number and decompile as expected in cleo scripts.

I'm trying to define a clear distinction between models and objects as it relates to special handling for cargens, but I'm also trying to confirm that my edit modes are configured with full support; I'm a bit confused about what's really supposed to happen.

Added: Here we go. sa_mobile mode with extended IDE files will decompile any object ID I throw at it. But sa, vc and gta3 modes do not.

Can't Compile or Copy to a Connected Tablet

Sanny can see the removable DVD drive, but can't seem to access the connected tablet at all. I was hoping to compile and copy directly to the game folder but can't find the device.

Change parameters in CLI to more common syntax with dashes

--game to select the default mode for the given game

\sa => --game sa, -g sa
\vc => --game vc, -g vc
\gta3 => --game gta3, -g gta3
\lcs => --game lcs, -g lcs
\vcs => --game vcs, -g vcs
\sa_mobile => --mode sa_mobile, -g sa_mobile

--mode to select a mode by ID (each mode has an ID attribute previously known as shortcut)

\debug => --debug
\compile input_file_path [output_file_path] => --compile "input_file_path" ["output_file_path"]
\nosplash => --no-splash

new:

-x "games.xml path" #15

Also see #14

Relative Paths for Custom.dat

The goal is to allow Custom.dat to use standard IDE lines without modification regardless of the location of Custom.dat or whatever Sanny considers to be the current directory.

Example:

PATH @SB:\data\Resources\data\gta_sa\sa_arm\

IDE DATA\DEFAULT.IDE
IDE DATA\VEHICLES.IDE
IDE DATA\PEDS.IDE

Introduce optimization options

SCM has plenty of low hanging fruit with optimizations which can substantially reduce code size, which might be useful for some bigger projects.

Two optimizations are very simplistic and should be easy to implement:

  • Skipping if 0 statements from high level constructs. When using manual jumps/else_jumps the user might save space by not including an if statement for single conditions, but for high level constructs it's not possible.
  • Replacing 0.0f with 0 - with former being 4 bytes and latter being 1 byte, script processor evaluates them to identical values. Safe even for comparison commands, as reinterpreting integer 0 as float 0.0 is okay.

More complex optimizations? Would be welcome, but they aren't nearly as trivial:

  • Simplifying labels - with high level constructs it's very common to see else_jump -> jump -> jump.... In theory they could be optimized and maybe it'd result in size and performance optimizations.

As far as those go, the two simple optimizations are kind of "must have", label analysis is a welcome extra but I am aware that it might be more complex than it sounds, so I wouldn't consider it high priority.

Can use constants in `quotation mark`?

Hey. Maybe should use quoted constants? For example:

`CONST_A` = 20.0
`CONST_B` = 0@
015D: set_gamespeed `CONST_A`
015D: set_gamespeed `CONST_B`

A regular expression should be find faster than full code analysis. When enter the @ character, it finds all labels; and when enter a quotation mark, can also search for constants. And it will be easier to highlight them.

Extended Constants.txt

I investigated how constants are assigned by 04AF: in San Andreas and used this information to add about 170 entries to constants.txt. I've grouped the constants under the following headings as an example of how the constants might be organized. Of these categories, 3 have potential for decompiling to specific opcodes, bool, sprites and bodyparts.

[GENERAL] - just the timers
[BOOL]=b - added yes and no, enabled and disabled
[SPRITE]=i - radar icons tend to get modded a lot
[BODYPART]=y - where to hang your hat
[TOWN] - town numbers
[RACE] - Race Index
[TOURNAMENT] where the races start
[CARMODS] bodyparts for cars
[PROPERTY] Buy Property Index
[SOUND] easy audio events that play without loading

sa_constants.txt

https://docs.google.com/spreadsheets/d/1ageNMPHWOFhVa7JgQ5-1aDuUKMgRPRFrMjvhJtZGKec/edit?usp=sharing

Edit Modes without Folders

Since the suggestions for new entries for opcode.txt and gxt got a favorable priority, only a few more steps are necessary in order to make edit modes completely contained within a game definition in games.xml. I've been trying to account for all-the-rest found in the data folder for the edit mode.

GXT and opcode.txt location are currently under consideration.

DAT and IDE files can be managed with \data. Possibly, look for default.dat and gta3.dat in the usual file structure if custom*.dat isn't specified.

Need Binary for managing only 4 files that don't need to change or propagate.

What else? I recently realized that Make opcode.txt tool writes to the data folder. This is fairly destructive behavior in the context of multiple edit modes sharing the same resources. For sa_mobile type edit modes the install directory might be a more appropriate destination.

Binary Number support

Currently Sanny supports decimal numbers (both whole integers and floating-point number) and hexadecimal numbers.

-1, 0, 1, 1.0, 0.0. -1.0 - decimal
0x0, 0x100, 0xFF - hexadecimal

In some cases it's useful to represent a number in binary form (as a sequence of zeros and ones). E.g. bitmask values. In other programming languages it's common to see such representation with the prefix 0b and zeros and ones following:

0b0, 0b010100

This format should be the first-class citizen and supported anywhere a number is allowed.

Special Hex String Construct for Mobile Label Addresses

The issue is that CleoA uses a label search strategy to find structure addresses so scripts are compatible with multiple versions of the game. The hex constructs used to store the label string won't decompile without IGNORE_UNKNOWN, and is returned as a hex bytes. which works, but provides little useful information on how to adapt the code.

These constructs are always used in combination with a label used by opcode 0DD0:. I'm wondering if that's enough information for Sanny to format the hex construct as a null terminated string. Or maybe there's a better solution, because this "Magic Hex" construct is extremely common in CleoA scripts - anything that accesses memory and isn't complete garbage.

Example (used in script body):

// Markuza97's any-version address codes - read once
0DD0: 6@ = get_label_addr @_ZN6CRadar13ms_RadarTraceE
0DD1: 6@ = get_func_addr_by_cstr_name 6@ // start of marker structure
0DD0: 7@ = get_label_addr @gMobileMenu   
0DD1: 7@ = get_func_addr_by_cstr_name 7@ // start of... menu data?
000A: 7@ += 0x48 // offset to marker index

Labels (traditionally appended to the end of the script):

// Markuza97's magic hex codes
:gMobileMenu
hex
"gMobileMenu" 00
end

:_ZN6CRadar13ms_RadarTraceE
hex
"_ZN6CRadar13ms_RadarTraceE" 00
end

Explore Command Line Enhancements

The current objective is to automate the process of updating opcode.txt. Sanny would need to:
Compile using a specific edit mode (working)
Decompile with an updated edit mode
Make opcode.txt from the output file
Use a settings.ini specific to this task

The command line process doesn't work well when Sanny is already running. I usually make a duplicate of the exe (Sanny3) to manage batch processing. Perhaps a compact experimental command line only compiler might be more appropriate for these tasks. A different tool could use a different settings.ini and games.xml and be independent of Sanny's current configuration, but still operate from the same program directory.

Request: To Compile Identical Script for PC or Mobile

The overall problem occurs when a script is developed on PC and ported to Android - it's difficult to maintain updates in the PC "prime" file as I make adjustments to the Android version based on testing. Script management would be much easier there was a method to only compile certain code segments if a specific edit mode was enabled.

This idea was suggested by the form used in one of my current scripts. I'm not really sure how a solution might work or look - I didn't want to throw out a problem without offering any kind of solution. This illustrates the idea nicely, and looks pretty similar to the code I'm currently work with.

Idea 1:

{SA
// compile commands only if edit mode is SA
} 
{SA_mobile
// compile commands only if edit mode is SA_mobile
} 

BlipFix6.txt

A snippet from a project to reset radar blips to standard markers only. Currently I need to move the end brackets around to port the script::

{SA}
0ADF: add_dynamic_GXT_entry "BLIPS1" text "Active blips found: ~y~~1~~s~ of ~y~~1~~s~"
0ADF: add_dynamic_GXT_entry "BLIPS2" text "Stray destination blips removed: ~y~~1~~s~~n~Hidden blips removed: ~y~~1~~s~"
0ADF: add_dynamic_GXT_entry "BLIPS3" text "Unknown blips removed: ~y~~1~~s~~n~Current blips active: ~y~~1~~s~ of ~y~~1~~s~"
0ADF: add_dynamic_GXT_entry "BLIPVAR" text "~r~Abnormal VarSpace!~s~"
0ADF: add_dynamic_GXT_entry "BLIPOM0" text "~r~Player on Mission!~n~~s~Current blips active: ~y~~1~~s~ of ~y~~1~~s~"
0ADF: add_dynamic_GXT_entry "BLIPYAY" text "~r~Yay Courier Active!~n~~s~Current blips active: ~y~~1~~s~ of ~y~~1~~s~"
0ADF: add_dynamic_GXT_entry "BLIPGRL" text "~r~Girlfriend Active!~n~~s~Current blips active: ~y~~1~~s~ of ~y~~1~~s~"


while true
  wait 0
  {SA}
  if  
    0ADC:   test_cheat CheatString 
  then
  {SA_mobile
  if  
    zero == 0 // triggered with Cleo Menu
  then
    gosub @Get_Android_Addresses }
    if or
      not &3(zero,1i) == NormalVarspace
      $OnMission == true
      $YayCourier_Active == true
      08B4:   test $Dating_Flags bit Dating_OnDate 
      08B4:   test $Dating_Flags bit Dating_Meeting
    then
      gosub @Error_Report
    else   
      gosub @Fill_MarkerArray
      gosub @Get_Special_Markers
      gosub @Create_Handle_Array
      gosub @Remove_Stray_Blips
      gosub @Remove_Hidden_Blips
      gosub @Ignore_Standard_Markers
      gosub @Remove_Unknown_Blips
      gosub @Count_Current_Blips
      gosub @Display_Report
    end
    {SA_mobile end_thread}
  end
end

Android CLEO issue.

Finally, there is an Android CLEO issue.
I am trying to implement static injection of ARM assembly code in Android CLEO. I succeeded, but there is an architectural problem. I very much hope that the SB tool can add a function to solve the problem:

{$CLEO .csa}
0000:
jump @1

:ASM
hex
 AEF12D00 //SUB R0, LR, #0x2D
 F746     //MOV PC, LR
end

:1
wait 0
0DD0: 39@ = get_label_addr @ASM
0DD8: 1@ = read_mem_addr 39@ size 4 add_ib 0
39@ += 4
0DD8: 2@ = read_mem_addr 39@ size 2 add_ib 0
39@ -= 4
0DD9: write_mem_addr 39@ value 1@ size 4 add_ib 0 protect 1
39@ += 4
0DD9: write_mem_addr 39@ value 2@ size 2 add_ib 0 protect 1
39@ -= 4
//It must be read first, and then written as protect 1. 
//Because what Android CLEO.so is loaded is not the game memory space,
// but the static memory space allocated by the Android system, 
//which cannot be accessed directly. 
//This may be because of the rigor of the Android system

39@ += 1 
//Because it is a thumb instruction, the return address is automatically +1
//BLX will automatically recognize the switching instruction set
//The lowest bit of BLX address is 1 for Thumb, and 0 for Arm
//Android GTA uses ARMV7 and Thumb mixed instructions
0DD2: context_call_func 39@
0DD4: 0@ = context_get_reg 0 //0@= asm call addr
0DD8: 10@ = read_mem_addr 0@ size 1 add_ib 0
01E5: show_text_1number_highpriority GXT 'NUMBER' number 10@ time 10000 flag 1
end_thread

The above code gets the memory address of the function asm_call in CLEO.SO in the Android cleo library, and reads its first byte for display.
Just test the code, in fact, 0DD2 CALL calls itself to access its own address. This is also the OP implementation of ODD2.

But the problem is not here. The ASM assembly code at the beginning must be placed at the beginning of CLEO. If placed at the end, the game will crash and report an error.
After I spent time researching, the error code is as follows:

Exception signal: 7 (SIGBUS)
Exception code: Ox1 (BUS_ ADRALN)

When accessing memory, the data is not aligned
The new code is placed at the end:

0DD0: 39@ = get_label_addr @ASM
0DD8: 1@ = read_mem_addr 39@ size 4 add_ib 0
39@ += 4
0DD8: 2@ = read_mem_addr 39@ size 2 add_ib 0
39@ -= 4
0DD9: write_mem_addr 39@ value 1@ size 4 add_ib 0 protect 1
39@ += 4
0DD9: write_mem_addr 39@ value 2@ size 2 add_ib 0 protect 1
39@ -= 4
39@ += 1
0DD2: context_call_func 39@
0DD4: 0@ = context_get_reg 0
0DD8: 10@ = read_mem_addr 0@ size 1 add_ib 0
01E5: show_text_1number_highpriority GXT 'NUMBER' number 10@ time 10000 flag 1
end_thread

hex
00
end

If you do not add hex 00 end here to fill a byte to align the data, the game will crash. I noticed that this problem only occurs in Android, which is also the particularity of the architecture. It seems that the CLEO code will affect the alignment in memory?
It would be better if SB can automatically add extra bytes when compiling Android CLEO, but this is only suitable for advanced Android CLEO development

:ASM
hex
AEF12D00 //SUB R0, LR, #0x2D
F746     //MOV PC, LR
end

Originally posted by @XMDS in #33 (comment)

Make CustomVariable.ini Tool

Consider adding a tool to Make CustomVariables.ini based on how the custom variables will be compiled. This is a difficult process to manage manually.

An application is to allow Sanny to manage the variables in a custom main.scm and produce a list that can be used to decompile that script with the same custom variables.

Another application is to update the current variables in a standard main,scm using the Alloc function.

Legacy Support and Compatibility

"existing keywords and classes must be preserved in order to keep backward compatibility"

Priority of Keywords: I thought I mentioned this issue in another context but now I can't find it. Keyword.txt can support multiple keywords for the same opcode, but the sort order, iirc, is to use the alphabetically last example.

I'm not sure how Classes are managed in this context. Can Sanny support more than one class definition and what is the priority for decompiling?

"it may well be that some descriptions in opcodes and higher-level instructions do not match"

I'm pretty sure that I read somewhere that SCM.ini can support multiple opcode definitions, and the last example encountered is the priority for decompiling. But I'm not sure if that matters for the INIs; just documenting the options.

Keywords for math operations are ugly and awkward. Better to keep those things working the same way.

CustomVariables.ini should have no trouble supporting the traditional names and an updated naming convention based on the official GTA3 variable names. I forget the priority for decompiling. I believe some of the current variable names are way off the mark.

Change Hotkeys for InstaSearch

Currently Instasearch uses Ctrl+Num[2,4,6,8] combos. The Num keys are hardly available on laptops that makes this feature unusable.

Proposal: change hotkeys to Ctrl+ArrowUp/Down/Left/Right. Deprecate old combos, keep for a couple versions then remove.

AudioEvents.txt as Constants

Because it was easy. Over 7000 entries though. Not sure of the implications.

The attached file is for PC. I know PS2v1 is different. It's probably pretty stable in PC releases and later. I'll check if this seems like a good use of this new feature.
constants.txt

Declaration of custom local variables

Background

Currently it's possible to assign a custom name to the local variable using CONST..END:

const
  x = 0@
end

then declare a type for this variable using VAR..END or the shorter form of declaration:

int x = 5

Proposal

Get rid of the const declaration step when the shorter form of declaration is used, i.e. given an expression like:

int x = 5

the compiler should assign x to the first available local variable index (0) and compile it as 0@ = 5. then if another variable gets declared (e.g. int y = 6) it gets assigned to the next index (1), and so on:

int x   // 0@
int y   // 1@
x = y   // 0085: 0@ = 1@

Known Limitations

  • the compiler is yet unable to detect if the opcode belongs to a particular script in the MAIN section (it's possible that some code in the middle of a script belongs to another script)
create_thread @a
create_thread @b

:a
int x = 0  // 0@ = 0
jump @a1

:b1
int x = 0 // 1@ = 0 error, should be 0@
end_thread

:b
jump @b1

:a1
end_thread
  • there is no look-ahead for local variables so it's not possible to identify if a particular index has already been used by the scripter or not.

Conclusion

Given the limitations, for the first iteration of this feature:

  • only allow the local variable declaration in a CLEO script

  • always assign the first declared variable to 0@, the second one to 1@, etc. The compiler would still validate if the number of defined variables exceeds the limit for the script

  • it's possible to use indexed local variables (0@, 1@, etc) and they may possibly clash with declared variables:

int x = 0
0@ = 1
wait x // wait 1
  • the compiler would throw an error if both forms of local variables are used. the first used form controls (i.e. if you have 0@ in the script first you would be unable to use custom variables as described above, and vice versa)

  • the documentation should clearly state that the order of variables assignment is undetermined and may change in the future (i.e. you should not assume that the first custom variable is always 0@)

Include Examples of High-Level Constructs in help\examples\

The original idea was to restore some of the example scripts included with Cleo3 because I found the showsavescreen script to be particularly useful as an example of a high-level construct. I've since reworked this script to be more sensitive to keystrokes and to use as a template for other basic trigger scripts.

F4SaveScreen.txt

Current MemoryHandling.txt includes the depreciated $Version directive.

Strategy for Refreshing games.xml

I can manage different games.xml files with User Tools and Shortcuts but I can't find a way to get Sanny to load the updated file without restarting the program. I was hoping to find a quick way to switch between different command profile sets but came up just a tad short.

Special Handling when Decompiling Random GarGens

Sanny will decompile the model of the random car generators in Angle Pine (SA) as #INFO instead of the expected -1 setting for a random model cargen. I understand this occurs due to object definitions in main.scm but it's still a surprising and confusion result for a cargen.

Special Handling Opcodes

The current issue is that special handling opcodes ignore command names and comments in sascm.ini and always decompile to text that isn't useful.
05B6 1 // CURRENT_WANTED_LIST = instead of 05B5: save_string_to_debug_file 1 // special handling

My other comment on special handling is a rather vague idea inspired by stumbling across an unusual opcode and not being able to resolve the matter without an update to Sanny. Can the 128 byte data blocks be typed (k%) so an opcode could be defined similar to:

0A68=3,write_log_float %1d% %2d% %3d% case %4k%

Inconsistent Operation of Ctrl+Alt+H Conversions

Ctrl+Alt+H is working on Win7 but not Win10, but I doubt that OS is a primary factor. I've read reports about this problem but don't remember the solution and can't find the old reference.

Is this a known issue or should I try to track down the glitch? How do I fix it?
Can anything be done to improve the stability of this tool? I've had past issues.

3.4.0 Release Plan

This issue documents features and fixes planned for the next release:

  • VCS compiler support #2
  • callable gosubs (incl. highlighting and auto-complete)
  • shorter form of local variable declaration (#32 )
  • GXT entry in games.xml #7
  • opcodes.txt entry in games.xml #5
  • online documentation link
  • Ctrl+Alt+H label in options #22 sannybuilder/translations/issues/2
  • minor opcode description updates (player money +=, award_achievement, 0479 in VCS)
  • new cleo script from menu
  • templates per edit mode #39
  • ZAZ tutorial #24
  • Run Game for GTASA should check gta-sa.exe (Steam)
  • Revert GXT text files #25

Remove SAMB converter

As of 2020 scripts written in SA Mission Builder format are uncommon so this feature can be removed.

Share the converter as a standalone tool on the website in case anyone still interested.

Conform to User Account Control on Windows

Windows prevents or alters some operations:
https://en.wikipedia.org/wiki/User_Account_Control#Tasks_that_trigger_a_UAC_prompt

If Sanny Builder runs with non-elevated rights (user) the following would not work:

  • file association #47
  • writing settings.ini* (when it's installed In Program Files)
  • updating opcodes.txt* #14
  • saving new templates* #154
  • any decompiler and compiler output run against files located in Program Files*

* Windows generates those files in "C:\Users\username\AppData\Local\VirtualStore\Program Files\Sanny Builder 3" thanks to File and Registry Virtualization

This can be bypassed if run sanny.exe as administrator.

SAGXT.text Missing Entries and Tables

It was brought to my attention that the 3.3.3 version of SAGXT.text is missing the entry for FEM_OK that used to be included in older versions. The Public version appears to be the same. The two files are so different that it's not easy to compare the files for issues with other entries.

The entries are no longer sorted into their GXT tables. This makes this file considerably less useful than previous versions.

I'm not sure when the files changed or why.

Admin Mode and the Coords Manager

I generally don't run Sanny as an Administrator because file associations don't work properly in the Explorer if Sanny if already running. I also don't install Sanny in the default Programs folder so I don't need to fight Windows for security when editing the data files.

My primary reason for running Sanny in admin mode is to use the Coords Manager. Can the coords manager component of Sanny be broken out in such a way that it can have it's own security settings and still maintain the same functionality within Sanny?

Custom Classes proposal

Class Syntax

Here is the proposal to add a new syntax for defining custom classes in scripts. They may eventually become a replacement for static classes in the classes.db.

Let's take a look at an example:

class Actor
  putInCar(car)
     036A: put_actor self in_car car
  end
end

var
  0@: Actor
end

[email protected]($car)

Here we defined a class named Actor that has one method putInCar in. putInCar method has one parameter car. Then we declared a variable 0@ of the type Actor and finally called method putInCar on that class instance.

Important Notes

  • class declaration is lazy. it means no code is produced until it gets actually used in the code. if we were to remove [email protected]($car) no code was produced in this script.
  • each method receives an implicit variable self that represents the class instance the method is called on. in this case it is the variable 0@
  • in this example [email protected]($car) gets compiled into 036A: put_actor 0@ in_car $car

Design Choices

  • when there is a method call statement the compiler takes the method body and replaces the statement with the entire body. it means the method could have many instructions and possibly even labels and they will be put in place of the call statement. in this sense class method are more templates than functions as in the other languages.

  • this however does not prevent local variables from being altered inside the method body. it means there is no separate scope created when the class method is called and if you, for example, change the variable 0@ in the class method it will be a side-effect for the caller:

class Actor
  putInCar(car)
     036A: put_actor self in_car car
     0@ = 2
  end
end

0@ = 1
[email protected]($car)
// 0@ is now equal to 2

There are a few possible choices to this dilemma:

  1. leave it as is, considering this a liberate language design decision (when you invoke subroutines with gosub they could alter local scope as well)
  2. forbid using local variables syntax inside methods. only use arguments passed into the method. this could be inconvenient if you need to keep a local state.
  3. add extra prologue and epilogue before and after each method call that will store and restore all local variables. this adds extra overhead in runtime
  4. use CLEO's scm_function that basically does # 3. this adds unnecessary dependency on CLEO.
    • however if preserving a local scope is important, one could consider using a scm function inside a method body:
class Actor
  putInCar(car)
     0AB1: call_scm_func @local 0

     :local
     036A: put_actor self in_car car
     0@ = 2
     0AB2: ret 0
  end
end

0@ = 1
[email protected]($car)
// 0@ is still 1

Can make it possible to create labels with the TAB key?

Is it possible to use the TAB key (or define some other) in a certain place, so that then a certain action is performed? For example: I write code like this:

jf @label

After that, I press that key, and at the end of the code, a label is inserted if it does not exist:

jf @label
//...

:label // +++

It will help save a time for jump tables and more.

Templates must be per edit mode

Currently there is one file templates.txt (macroes.txt) with a single list of templates for all games. Each mode should specify its own list of templates that IDE loads on edit mode switch.

3.5.0 Release Plan

https://github.com/sannybuilder/dev/milestone/1

  • update CLI
    • new syntax with dashes #42
    • new parameters -x, --game, --mode #42
    • modes hot reloading #15
  • edit modes enhancements
    • games.xml renamed to modes.xml, inner names changed too (<games> -> <modes>)
    • modes can inherit properties of other modes (useful for different versions of one game)
    • new mode for SA 2.0 (with CustomLabels_v2.ini)
    • separate modes for different versions of VCS #41
    • support for custom IDE/DAT files
      • mitigate the difference in file referencing in game DAT and custom.dat #18
    • increase space for mode name section #8
  • LCS/VCS support
    • fix LCS and VCS compilation #49
    • fix discrepancy in CustomLabels.ini offsets in LCS/VCS #52
    • enable constant_indexes debug option for LCS/VCS by default
    • update LCS/VCS with fastman92 opcode definitions sannybuilder/data#5
  • fix file association #43 (comment)
  • remove SAMB->SB converter #27
  • can't open Opcode Search Tool again after minimize #35
  • update documentation on CLI and modes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.