Author Topic: Rewrite Blockland in x86 Assembly  (Read 1864 times)

I will have the babies of anyone who does this.

Blockland is written in C++, which already compiles to assembly. You can see this assembly if you open the executable in IDA pro and other dissasemblers. Manually writing something in x86 assembly is a long and painful process, that's why we have C++ and C in the first place.

The one game I know of that was manually written in 86x assembly is Rollercoaster Tycoon 2. That game is now being rewritten in C by fans.

Apart from maybe RCT (and that's debatable) I have literally never heard of a large project being done entirely in assembly. I'm an assembly programmer myself (86x and MIPS) and I can tell you it's a pain in the ass to work with because you're so close to the hardware.

(This is assuming you're not asking a silly question on purpose)
« Last Edit: April 17, 2017, 03:01:03 PM by chrisbot6 »

Blockland is written in C++, which already compiles to assembly. You can see this assembly if you open the executable in IDA pro and other dissasemblers. Manually writing something in x86 assembly is a long and painful process, that's why we have C++ and C in the first place.

The one game I know of that was manually written in 86x assembly is Rollercoaster Tycoon 2. That game is now being rewritten in C by fans.

Apart from maybe RCT (and that's debatable) I have literally never heard of a large project being done entirely in assembly. I'm an assembly programmer myself (86x and MIPS) and I can tell you it's a pain in the ass to work with because you're so close to the hardware.

(This is assuming you're not asking a silly question on purpose)

That's assuming your assumption is correct.

I really did not expect a serious response.  Would it be a stretch to rewrite Blockland in C, or somehow port Torque to C? Can TorqueScript be modified by Eric?

That's assuming your assumption is correct.

I really did not expect a serious response.  Would it be a stretch to rewrite Blockland in C, or somehow port Torque to C? Can TorqueScript be modified by Eric?
Porting something from C++ to C is slighly counterproductive because C is just C++ with most of the features removed. There's not really a notable speed difference between the two (both are considered "ultrafast") but there are still reasons to backport:


Modifying Tork (as we tend to both affectionately and furiously refer to it) is possible but there's not really much reason to do so unless you intend to do a lot of work. If you're asking about binding additional functions to let us do more with the engine (for example, selective ghosting) that's not really modifying the language. Though I will point out that I have the source code for the version of Tork blockland was built in and a stupid amount of useful engine features have not been bound to the scripting engine, making them unusable in add-ons. These include environmental sound, most of the drawing system, etc.

Tork is mainly slow because of its habit of performing far too many unnecessary string conversions, and these are necessary because of how the language is designed. (i.e. badly)

Tork's object system relies on every scriptable object being in a massive lookup table. Everything not only has an ID, but can be renamed too and accessed through that name. Things can have things inside them, and there's no optimization for that. The closest thing we have to a null variable is literally "". Tork masquerades as a freely typed language with no way to get or cast between types, and that's because everything is a string.

This string based design sticks out even more when you realise that Tork's solution to passing vectors to, around and from its scripting engine is still (see the GarageGames repository for Torque3D) the word, field and line system - i.e. converting things to strings, converting those individual strings to numbers to modify them, converting them back, passing them back to the engine, converting them back to individual numbers, converting those three back to a vector.

This is why torque has individual string ($=, SPC, @ etc) and number (==) operators, why everything has a numerical and string value, and why, above all, the engine feels so damn slow when you try to make something without doing anything with C++. The engine is not bad. The scripting system very much is.

I'm serious. Here's a github issue where the first reply is one of the GarageGames devs recommending the user just ditch Tork's terrible scripting engine.
« Last Edit: April 17, 2017, 04:25:31 PM by chrisbot6 »

Porting something from C++ to C is slighly counterproductive because C is just C++ with most of the features removed. There's not really a notable speed difference between the two (both are considered "ultrafast") but there are still reasons to backport:


Modifying Tork (as we tend to both affectionately and furiously refer to it) is possible but there's not really much reason to do so unless you intend to do a lot of work. If you're asking about binding additional functions to let us do more with the engine (for example, selective ghosting) that's not really modifying the language. Though I will point out that I have the source code for the version of Tork blockland was built in and a stupid amount of useful engine features have not been bound to the scripting engine, making them unusable in add-ons. These include environmental sound, most of the drawing system, etc.

Tork is mainly slow because of its habit of performing far too many unnecessary string conversions, and these are necessary because of how the language is designed. (i.e. badly)

Tork's object system relies on every scriptable object being in a massive lookup table. Everything not only has an ID, but can be renamed too and accessed through that name. Things can have things inside them, and there's no optimization for that. The closest thing we have to a null variable is literally "". Tork masquerades as a freely typed language with no way to get or cast between types, and that's because everything is a string.

This string based design sticks out even more when you realise that Tork's solution to passing vectors to, around and from its scripting engine is still (see the GarageGames repository for Torque3D) the word, field and line system - i.e. converting things to strings, converting those individual strings to numbers to modify them, converting them back, passing them back to the engine, converting them back to individual numbers, converting those three back to a vector.

This is why torque has individual string ($=, SPC, @ etc) and number (==) operators, why everything has a numerical and string value, and why, above all, the engine feels so damn slow when you try to make something without doing anything with C++. The engine is not bad. The scripting system very much is.

I'm serious. Here's a github issue where the first reply is one of the GarageGames devs recommending the user just ditch Tork's terrible scripting engine.

Strongly typed object oriented programming when? C's syntax would be nice to use, too...

EDIT: Why not just simplify variables in Torque by giving the ability to declare simpler data types? For example, declaring "string" for a stringed variable and "int" for numbers and letters?
« Last Edit: April 17, 2017, 05:08:28 PM by theviacom »

its not a matter of just changing it - the engine was written around that weak typing and so would require a lot of rewriting to support typing. doing this would also break practically every mod in existence

to put this in perspective: by changing one byte in the code you can disable scientific notation for numbers past 999999, but if you do it you will break the engine in many different ways, as port has tried.
« Last Edit: April 17, 2017, 05:13:49 PM by Conan »

uhmmm...

That is not a good idea at all

Because it would be "time-consuming" and not every computer would support the game. (because you are just writing it to x86 platform only).
« Last Edit: April 17, 2017, 06:00:13 PM by FelipeO_O_ »

uhmmm...

That is not a good idea at all

Because it would be "time-consuming" and not every computer would support the game. (because you are just writing it to x86 platform only).
there is no blockland 64 bit

64 bit computers can run 32 bit programs also

there is no blockland 64 bit

64 bit computers can run 32 bit programs also
This
62 bit can run 32 bit, but not the other way around.