• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Galaxy Problems - Petition draft

Status
Not open for further replies.
Level 4
Joined
May 17, 2008
Messages
75
People say that if you make a timer at 0 second intervals that it will expire every ~0.03.

I have not confirmed this (I have only worked with the Data Editor so far), but that's what they say.

While they do say this, and 0.0 waits appear to try to increment 1/32 seconds, I have never been able to get actual actions to execute anywhere but 1/16 second increments. Using 0.0 waits just makes the action execute twice at each 1/16 sec increment, as opposed to firing consistently at 32/second.

Everything in the game appears to operate on 1/16 second ticks, even movers.
 
Level 4
Joined
Dec 14, 2004
Messages
85
Can you actually justify why inheritance is needed in GEdit?

Show me a problem that needs solving then I can see if it needs inheritance.

"I said something about OO being a strong tool for game programming"
But we aren't "game programming"--most of the gritty stuff is already done. We are scripting an engine running in an already written game.

Be careful you might have given people the impression that you think OO is better for the "gritty stuff" which I'm fairly certain is not your opinion.

But in response, what you said would make even more sense if you were only scripting things for campaigns in a sc2 gameplay situation. But we saw from the videos that this map editing tool is capable of so much more(So was war3). I found vJass to be very helpful making a game that was like a table top strategy game(Similar to Warhammer the table top game, but with war3 races). In a game like that I mostly didn't use much of what would be considered the game and instead I used war3 mostly as a (Graphics, Input, Sound, Network) engine and reprogrammed all of the game code myself. In which case I found OO to be the best paradigm to solve the problem mostly to do because of the advantages of inheritance. Due to the fact that I had many objects which were base objects of something else. Weapons and Spells(Polymorphic relation in this case, if memory serves) were both capable of being used as an action. Swords and Bows both used code for attacking.

And for user input such as ending a turn or choosing units. I used functional scripts, because they fit that situation better. That's what was great about vJass, it had both.

Or they also showed a demo that opens up the possibilities of a Third person shooter(and I'm sure FPS), this would do a similar thing to SC2 as the above, it would use it as a (Graphics, Input, Sound, Network, Physics) engine. I could see a better argument for functional programming here than above, but there are elements that could still be best represented as objects especially if the game wasn't traditional to it's approach of the FPS or 3PS.

So yes you can solve all the mentioned problems in functional programming, but I believe the OO paradigm is set best for those problems. But also I mentioned I had scripts in my game for the actions, because scripts fit best there. I would like to see something similar, I would like to see a mixed functional and OO language. Because then it fits more types of problems, with small to possibly no disadvantages.

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

Now that I think about it, why isn't there an open source project for this? Maybe that's what we should be doing instead of a petition, historically petitions have accomplished very little(more accurately historically a mockery of the internet and the causes they stand for). Not to mention I'm not a big fan of working on Blizzard time pretending that they will do anything about an online petition(You're joking yourself if you think they didn't know what arguments you were going to put forth years before releasing the game, they are programming in an OO language and they know what OO is good for).

So what do you you all say? Community project? I've been planning on making galaxy for XText(Tool for adding languages easily to the eclipse IDE, including code assist!(Very useful)). Personally that's the first thing I would like to see is a good environment to code in. And from there we can create a compiler, of which would eventually include OO compilation.

*Edit* I went to check the original petition to check and make sure I wasn't blowing too much smoke by misunderstanding what the petition was in the first place, but I could get it to load, so if I am I'm sorry*Edit*

*PS I know not every one of the problems was OO and namespaces but I think I remember them being there in the petition, so this is hopefully part of a solution to that problem
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Show me a problem that needs solving then I can see if it needs inheritance.

"I said something about OO being a strong tool for game programming"
I can't really come up with good examples of wide ranges of problems off the top of my head, but you seem to provide some decent examples below.


Be careful you might have given people the impression that you think OO is better for the "gritty stuff" which I'm fairly certain is not your opinion.
If people draw that conclusion out of what I said, then they are just looking to confirm their belief, since what I said meant that whether or not OOP was better for the game engine itself was not the subject of the discussion.

But in response, what you said would make even more sense if you were only scripting things for campaigns in a sc2 gameplay situation. But we saw from the videos that this map editing tool is capable of so much more(So was war3). I found vJass to be very helpful making a game that was like a table top strategy game(Similar to Warhammer the table top game, but with war3 races). In a game like that I mostly didn't use much of what would be considered the game and instead I used war3 mostly as a (Graphics, Input, Sound, Network) engine and reprogrammed all of the game code myself. In which case I found OO to be the best paradigm to solve the problem mostly to do because of the advantages of inheritance. Due to the fact that I had many objects which were base objects of something else. Weapons and Spells(Polymorphic relation in this case, if memory serves) were both capable of being used as an action. Swords and Bows both used code for attacking.
You're the first person here who has actually posted a valid reason to want OOP, although in this case this example would be solved even better with first class functions, a little-known non-OOP concept.

And for user input such as ending a turn or choosing units. I used functional scripts, because they fit that situation better. That's what was great about vJass, it had both.
Being able to do everything often leads to a mess rather than greatness. Take C++ for example.

Or they also showed a demo that opens up the possibilities of a Third person shooter(and I'm sure FPS), this would do a similar thing to SC2 as the above, it would use it as a (Graphics, Input, Sound, Network, Physics) engine. I could see a better argument for functional programming here than above, but there are elements that could still be best represented as objects especially if the game wasn't traditional to it's approach of the FPS or 3PS.
You are talking about imperative/procedural programming, not functional programming.

So yes you can solve all the mentioned problems in functional programming, but I believe the OO paradigm is set best for those problems. But also I mentioned I had scripts in my game for the actions, because scripts fit best there. I would like to see something similar, I would like to see a mixed functional and OO language. Because then it fits more types of problems, with small to possibly no disadvantages.
I disagree (and once again, it isn't functional programming!), but I'm glad to see you actually brought up arguments to support your points. My counterpoint would be that almost everything you mentioned only needs data structures and methods (that is, it doesn't benefit from inheritance) and the one example that could have benefited from inheritance benefits even better from either multiple inheritance (which is a trainwreck) or first class functions, and first class functions are very nice for unrelated areas as well.
 
Level 4
Joined
Dec 14, 2004
Messages
85
I did know it isn't functional but everyone else was using the term so I did too, During the post I was looking over the paradigms and their differences and came up with about 3 that fit and decided that if I said functional people would know what I meant anyway because the entire thread has been using it in that way or at least it seemed to me.

Mostly my point was there are situations where OO is best suited, even if the entirety of it's usefulness cannot be explained in one post. I've seen some situations where inheritance is useful for reducing repeated code, and since I've been in that game's code itself I can see where it is similarly useful.

So once again I'm not trying to say it's best for everything. But I do like OO for a pretty good range of problems. And since I feel it's advantages could be useful I would like to see OO be introduced in some form such as a pre-compiler like vJass. It would be a welcome addition.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
And functional languages have certain advantages too, but I won't be implementing one in SC2 any time soon (or if I do, I won't be releasing it for actual use, only as a toy and for interest purposes... but I probably won't so it's a moot point--I'll write a real compiler if I want to write any compiler/processor). Why? Because "something being useful in certain situations" is not "the coding community needs a million different corner case solutions based on peoples' arbitrary preferences". The fact is, there are so few cases that it's useful (the fact that we are struggling to come up with examples is evidence of this) that you don't reduce your programming time by a meaningful amount.
 
Level 10
Joined
Nov 28, 2008
Messages
655
And functional languages have certain advantages too, but I won't be implementing one in SC2 any time soon (or if I do, I won't be releasing it for actual use, only as a toy and for interest purposes... but I probably won't so it's a moot point--I'll write a real compiler if I want to write any compiler/processor). Why? Because "something being useful in certain situations" is not "the coding community needs a million different corner case solutions based on peoples' arbitrary preferences". The fact is, there are so few cases that it's useful (the fact that we are struggling to come up with examples is evidence of this) that you don't reduce your programming time by a meaningful amount.


Why are you SO against OOP in star2?

Do all of your anti-OOP stuff, and ignore the OOP stuff.

Simple, end of argument.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
OOP is not vital that is why. It is basically eye candy.

Yes we all do not want to program in the virtual machiene assembly, but do we really need to go as far as everything being object orientated?

I would much perfer better memory management support like being able to allocate and dealocate arrays during the game runtime rather than being forced to use initially difined global arrays or local arrays which expire. I am aware that there are equivelent structures to hashtables, but for some tasks axcess to such features as described above would be more efficent.

Additionally if they finished the struct structure so you can allocate them after map initialization would be cool as you could then have easy axcess to complex data management systems (relationships) which would allow efficent axcess of data.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
/signed

Blizzard better fix many of these problems by the time the editor comes out of beta... I don't see how they could expect small development teams to make high quality maps for money if the editor stays this shitty.
Shitty. Uh-huh. You expected the sun to shine out its every orifice, and it only shines out some, so you call it shitty? It's an amazing tool as it is, and most of these "problems" are whiny newbies who think they can program complaining that they might have to do it a different way than they're used to.

Why are you SO against OOP in star2?

Do all of your anti-OOP stuff, and ignore the OOP stuff.

Simple, end of argument.
By this argument we should be able to implement everything we want. Let's implement LISP in SC2; you can always ignore first class functions and macros, but you will still hate it because it's both unnecessary and (in this case) outside of your experience.

Beyond your stupid argument, you're also wrong; a truly OOP language (Java for example) forces you to model code around objects according to many definitions of the term (hence why it is object-oriented rather than just having objects), hence why many people hesitate to call C++ and co OOP. There is a difference between "being" OOP and "supporting" OOP.

--

I oppose OOP for what DSG said and more. In SC2, it's not only eye candy, it's could actually very well be detrimental; you have people left, right, and centre programming in OOP when they really shouldn't be, and thus making a total mess. Imagine if maps were scripted in Java or C++ (and yet "Andromeda" is really Java:SC2, so we may see this)...
 
Level 8
Joined
Aug 4, 2006
Messages
357
Sorry, shitty was not an accurate word to describe the Galaxy Editor. Disappointing was more like it.
My main problem with the Galaxy Editor is how hard it is to script in it. I can't stand to do GUI anymore. And I'm not just a whiny newbie who thinks he can program; I'm a whiny newbie who can program... and I'd rather program in C than in GUI.
At the moment the Galaxy Editor seems like a step backward from the wc3 editor as far as scripting goes. I didn't expect the sc2 editor to shine from every orifice, but I did expect it to be just as powerful as the wc3 editor. At the same time, I recognize that this is not a finished product. It is a beta version that was released for us to find bugs and give Blizzard feedback, which is exactly what we should do, such that the final version will live up to our expectations.
 
Last edited:
Level 1
Joined
Jan 8, 2010
Messages
7
By this argument we should be able to implement everything we want. Let's implement LISP in SC2; you can always ignore first class functions and macros, but you will still hate it because it's both unnecessary and (in this case) outside of your experience.
Yes, yes we should have that and more.

"When a man cannot choose he ceases to be a man"
The thing is you got it backwards. We should make functional, object-oriented, etc. interpreters. You should program in what you are most comfortable to program. If that's LISP, fine. If it's Java, fine again.

Sure they'll be some performance penalty for using objects. That's a trade-off. A good developer will know when to trade speed for functionality. You can't stop bad or mediocre core, with or without OOP. You can however make it more apparent.
 
Level 8
Joined
Aug 4, 2006
Messages
357
Yes, but is "it isn't OOP" actually useful feedback? I'd argue it's pointless whining that you have to do it (not detrimentally) differently than you are used to. I agree we need to give them feedback, but I disagree that large parts of this are useful feedback.

No, you're right. "It isn't OOP" is not good feedback. I honestly don't care if Galaxy is OO, but it would be nice if I could actually script in it, if I could make timers with wait intervals faster than the human eye can see, if I could use hashtables, use function pointers, and pass things by reference.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Yes, yes we should have that and more.

"When a man cannot choose he ceases to be a man"
The thing is you got it backwards. We should make functional, object-oriented, etc. interpreters. You should program in what you are most comfortable to program. If that's LISP, fine. If it's Java, fine again.

Sure they'll be some performance penalty for using objects. That's a trade-off. A good developer will know when to trade speed for functionality. You can't stop bad or mediocre core, with or without OOP. You can however make it more apparent.
In an ideal world you'd be right (and you are definitely bang-on in the last paragraph), but the modding community is not large enough to support a number of different standards for code sharing purposes and such. A multiparadigm language like vJass (though thought out before hand) is healthy because it forces people into a distinct set of rules but still gives time a significant amount of freedom.

Andromeda (the solution of gex) is quite literally a Java/C# syntax copypaste which discourages any procedural coding and does not have good support for much other than classes for everything (classes as libraries, classes for scripts, etc). If we are going to take a standard with the most choice, even galaxy itself is more open than that.

I intend to write a short essay/rant on the subject this weekend.
 
Level 10
Joined
Nov 28, 2008
Messages
655
In an ideal world you'd be right (and you are definitely bang-on in the last paragraph), but the modding community is not large enough to support a number of different standards for code sharing purposes and such. A multiparadigm language like vJass (though thought out before hand) is healthy because it forces people into a distinct set of rules but still gives time a significant amount of freedom.

Andromeda (the solution of gex) is quite literally a Java/C# syntax copypaste which discourages any procedural coding and does not have good support for much other than classes for everything (classes as libraries, classes for scripts, etc). If we are going to take a standard with the most choice, even galaxy itself is more open than that.

I intend to write a short essay/rant on the subject this weekend.

Seriously dude, get off the pedestal.

We all know that you hate OOP. EVERY POST YOU MAKE is a bitch about other people and you saying that everyone wants this to be OO and nothing else.

We get it.

You can stop now.
 
Level 1
Joined
Jan 8, 2010
Messages
7
Andromeda (the solution of gex) is quite literally a Java/C# syntax copypaste which discourages any procedural coding and does not have good support for much other than classes for everything (classes as libraries, classes for scripts, etc). If we are going to take a standard with the most choice, even galaxy itself is more open than that.

I intend to write a short essay/rant on the subject this weekend.
Aside from packages and some syntax, I think Andromeda allows Galaxy syntax (I think he himself said it was an extension of the Galaxy syntax). If that's not the case you could just ask him to allow Galaxy syntax inside. What does sadden me about Andromeda is that it has no type interference. IMO that would be way more awesome.

Post a link if you do it on an obscure site.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
I intend to post it here. As for Galaxy syntax, yes, he allows it, but the design document mentions that he intends to specifically discourage it (look at what happened with JASS/vJass).

Seriously dude, get off the pedestal.

We all know that you hate OOP. EVERY POST YOU MAKE is a bitch about other people and you saying that everyone wants this to be OO and nothing else.

We get it.

You can stop now.
Actually, I like OOP and use it/have used it a good deal. However, I also like other paradigms and don't feel it's healthy to support one at the expense of the others in a small community which cannot support both, hence my complaints.
 
Level 1
Joined
Jan 8, 2010
Messages
7
Interesting. Gex did say, that he intends to discourage pointer use, which is ok seeing how he already uses pointer to make classes (does Galaxy even support a pointer pointer?).

@tagg1080: OOP comes with a performance issue, because as Joe Armstrong said: "The problem with object-oriented languages is they've got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle."

If you examine the Andromeda output code, you'll see this is exactly what happens in Andromeda. IIRC each class in Andromeda becomes a struct with at least one additional field (type). Same thing goes for enrichment. You not only import the one function you need to use, you import the whole enrichment. If Starcraft bytecode had a VM with JIT support and Andromeda interpreted into bytecode this wouldn't be a much of a problem, but to my knowledge this ain't the case :(
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
For example, from 5.1,

Andromeda encourages you to arrange all your functions as static methods of classes (many oop languages require you to do so, as they support no standalone functions). This allows for encapsulation and arranges methods that belong together.

Yes, it's only a "standard", but often everything but the standard becomes unacceptable and thus this standard would essentially make backwards-compatibility irrelevant.

That's not to mention all the crazy stuff like int i = (int)"42";, which makes no sense.
 
Level 1
Joined
Jan 8, 2010
Messages
7
For example, from 5.1,

That's not to mention all the crazy stuff like int i = (int)"42";, which makes no sense.
Hmm. I missed that.

How is that crazy? It's typecasting a string to an int. I think this is possible in C, unless I'm mistaken (yeah you'd make an essentially error of treating char* as an int but it was doable). Besides it relies on the Blizzard StringToInt method.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
There's a reason why nobody else does that.

It makes no sense compared to the rest of the casts--they are two unrelated types (for example, languages that support booleans don't want you casting them to and from ints that way) and casts are usually only between numbers or pointers. In addition, just because C can cast anything (and in this case, as you said, (int)"42" would not be 42) doesn't mean any sane language should.

(int)"42" looks logical, but what about (int)"hello" or (int)s? Neither of those have a well-defined behaviour (you could say the first is 0 and the second is from applying the first two rules to its contents, but it's best to explicitly make it clear by that point that you are using a function that does it step by step). (numtypeA)numtypeB or (typea *)pointertypeb are very clear (the first mathematically and the second based on how pointers work), but nothing else is.
 
Level 1
Joined
Jan 8, 2010
Messages
7
Good thing I still remember those C lesson :) First thing I thought when I saw that was format string, second was: hash. And that method is nothing if not hash. geX should probably address that. It's just an idiosyncrasy between Blizzard and how we expect functions to behave.

So basically int i = (int)"42"; becomes i = "42".hash.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Lol, I told everyone that SC2 is going to suck (the language) but nobody wanted to believe me. Here you have it, with regards of me.
Even if you did say this then this only proves two things:

1) You're arrogant.

2) You don't know what a beta is.

If you say stuff often enough, sooner or later you'll be right, so if you turn out to be with regards to this then it won't prove anything.
 
Level 8
Joined
May 15, 2008
Messages
492
Originally Posted by Anachron View Post
Lol, I told everyone that SC2 is going to suck (the language) but nobody wanted to believe me. Here you have it, with regards of me.

Meh its sorta true but you have to realize that this is just the beta. They are only giving us the editor to learn how to use it so you can't expect it to be perfect. Although I have read somewhere that on the latest talk with Blizzard, they said Galaxy scripting language will not be in the game so if this is true, Blizzard is probably going to release it in expansions which is a pretty gay thing to do.

EDIT:
Q. Getting custom script into maps is currently complex. Are there plans to implement Galaxy scripting directly into the editor?
A. There are currently no plans for Galaxy script editing in the editor itself. However, through the Import Manager it should be pretty easy to add in your scripts as necessary. Are you having trouble doing it that way?

Post #8 http://www.sc2mod.com/board/index.php?page=Thread&postID=227#post227
 
Even if you did say this then this only proves two things:

1) You're arrogant.

2) You don't know what a beta is.

If you say stuff often enough, sooner or later you'll be right, so if you turn out to be with regards to this then it won't prove anything.
Fail interpretation of that Q/A. All they're saying is that they're not planning on making it any easier to get scripts into your map.
That's my answer as well. They don't plan to change it, I know it's a beta, but it doesn't care if they don't plan to fix their bad stuff.

They want the users to use their GUI, not to use GALAXY.
And no, I am not arrogant, I am a realist.
 
Level 9
Joined
Nov 28, 2008
Messages
704
Andromeda needs work, but is fast proving amazing.

I am curious about this 2^21 byte limit though. It appears to exist, but surely Blizzard couldn't fail that bad?
 
Level 15
Joined
Sep 3, 2009
Messages
1,521
Whenever something comes out there will always be problems with it. Give it until it comes out to criticize it. The limits are probably put out due to limit the extent we go with it as its still beta. Sorta like a demo you can only play the first 2 levels or some sort. Just wait a little guys.
 
Level 9
Joined
Nov 28, 2008
Messages
704
Whenever something comes out there will always be problems with it. Give it until it comes out to criticize it. The limits are probably put out due to limit the extent we go with it as its still beta. Sorta like a demo you can only play the first 2 levels or some sort. Just wait a little guys.

Do you understand the issue? This isn't a neutered version of something real - this is the virtual machine for something huge, they didn't add this limitation, it is built in and they cant do anything about it without a lot of work.

I want to know what they were smoking when they made it in the first place.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
Its cause they created a virtual machine to handle the code unlike WC3 which compiled directly into machine code (or atleast seemed like it). Basically its like JAVA but in SC2 as far as what it does.

As such it is a lot more robust and less prone to leaks cause a lot of the stuff is handled specificly by the virtual engine and not the game. However the problem is that it is required to precompile into virtual machine instructions which are 32 bit. As such they only have like 20 bits to work with due to 12 or so bits covering other stuff in the engine.

4 MB is a lot, most SNES games were under 4 MB.

The major dissapointment was the restrictive nature of the type of programming choosen. Unlike in real programming where you can do stuff like dynamically allocating arrays based on conditions in a program or being able to call a variable function, SC2 does not allow this.

The whole problem is SC2 uses static variable addresses for its globals. This means that as soon as the script is precompiled before it is even translated into machiene code, the exact location of the global variable for the rest of the game is known. This is perfectly fine as you do not want your globals hopping around the memory address space as that would do nothing but waste cycles and make managing them awkward and dangerous. However the major fault is arrays are known as a modification for variables, and thus are allocated in blocks of address space. This leads to the easy to produce problem I demonstrated where I just made a 540000 large array which will overflow the address space and thus not compile and error.

Thus static arrays are a potential major problem, as you will need quite large blocks to simulate dynamic arrays and combined with huge instruction numbers you could eventually hit the 4 MB limit. This however will only be a problem probably after 4+ years of SC2 where maps might actually start approaching that limit. Also locals are affected with their own size limit due to locals using the stack while globals use a fixed address in memory.

It logically is a major brick wall if you try and do anything array (data) intensive like some form of bitmap animation or perhaps something silly like a huge neural network (why in SC2?).

They could have easilly and might still easilly get around the major size restrictions by adding 2 things.
Non array allocation support as well as the current static allocation kind so you could choose what sort you wanted to use. This would mean no complex slow systems are needed to allocate array space from one huge massive array as well as no wasted space when it comes to the 4 MB limit as larger arrays could be created independantly outside that limit (like objects are). Blizzard probably did not do this cause of the hassle of memory management of the arrays and also the potential leak problems it could cause as well as other things which would give them sleepless nights.

The other would be the ability to load separate script files with their own 4 MB limit but which can not communicate with the main map script. Aka the multiple virtual engine principle. They could even be stipped down versions of the main one sharing common features for improved performance. Would probably be irritating to program and sync everything correctly. Also only advanced people actually would understand how to use it.
 
Status
Not open for further replies.
Top