-
Re: I bring thee not simple rearrangements, but a whole new world of possibilities,,,
Yeah I took a look at some of those including XNA. Not really a fan, I like working low-level for this type of programming.
-
Re: I bring thee not simple rearrangements, but a whole new world of possibilities,,,
I guess I was a bit rash the other day. Been a bit tense lately.
I also want to re-emphasize. My knowledge of coding has grown tremendously since I started 12D. I would have chose to use C++ now but back then I didn't. That's just how things go.
Quote:
Originally Posted by
Kornman00
1. C++ compiles directly to the native architecture, whereas Java and .NET don't since they both use a VM/runtime which is natively compiled and executes their intermediate byte codes. You would only need to compile separate distributions with Mono if you're using MS.NET
APIs that it doesn't support. Pretty sure there are an assortment of libraries which are not platform independent in Java as well.
2. A fanboy, in the context we seem to be using it, is essentially someone who ignorantly promotes something over another. You seemed to have neglected to keep up with cross platform advancements with .NET and Mono, hence why others attributed this label. You flat out called .NET awful. I was only doing my programmer civic duty and pointing how .NET, in the context of C#, has Java beat in terms of coding. I wouldn't have taken my joke post any further had you not done this.
3. I'm not a mod for this site. Modacity: the modding site without mods.
4. Maybe I should just say this now: kudos for doing this, especially in such a language/framework like Java. Yikes.
Never did any of us say what he's been working on wasn't impressive.
The absence of evidence is not the evidence of absence. So this Open Sauce being made by this "Kornmann" you speak of...he's rewriting the engine? Well, I don't know about this imposter, but the goal of the real OS is just about expanding the official Halo engines. You know, working with what already works, is already modded, what people already have experience with, and what is already played. Very different from what Not Inferno is working towards, albeit both advance in their own rights. But now we're digressing. So maybe you should take your own advice and 'grow the hell up'. Or just throw up your strawman in some other field and bitch about people "bitching" there. I really don't care.
I also don't recall NI explicitly asking for help. Pretty sure he even said he was keeping it closed source while he's working on it. Unless you mean "give praise" when you say "help out". Which I think people are already doing when they ask/say they want to try out modding his engine.
"1. See Patrick's post"
I would think the ridiculousness of my post, immediately following Pat's, would have hinted at the underlying sarcasm
I understand how VM based languages work. My point was that C++ is not natively cross platform, but you can port it to any platform so long as there are libraries to make it work.
My knowledge of C# was a bit dated yes. That was part of the problem here.
Thought you were a mod still welp.
I was planning on open sourcing to github recently but I unfortunately need to hire a lawyer to write me a license agreement and EULA. I want to retain the rights to the engine so that if I develop a commercial game on it (plan too in the future) I won't have to worry about copyright on contributions from other people and other shit.
I also have asked for opinions and suggestions about things (such as scripting language stuff and shader language stuff). Haven't gotten many replies about that though :saddowns:.
Quote:
Originally Posted by
Skyline
I lol'd. Discussing the language you are using for said topic is completely unrelated apparently.
It's not. It may have been when I started but I'm far past choosing a language at this stage.
Quote:
Originally Posted by
Skyline
I'm almost certain you can compile Java code under a Scala compiler and then you can continue coding in Scala, if not I'm sure there are converters as they are pretty similar as opposed to some name and syntax changes. That and Scala is basically a superset of Java if not more as some of their libraries are Java compatible.
I don't think that I'm going to be able to convert 14k lines of code + lwjgl + other libraries I'm using without rewriting a lot of stuff. Sorry.
The hell is scala anyways?
-
Re: I bring thee not simple rearrangements, but a whole new world of possibilities,,,
Quote:
I don't think that I'm going to be able to convert 14k lines of code + lwjgl + other libraries I'm using without rewriting a lot of stuff. Sorry.
The hell is scala anyways?
Whoo-Java compatible what's that-oosh.
You'd only convert your code but you wouldn't even have to, you can compile both Java and Scala sources through the Scala compiler. The only reason you would want to is for sanity of having everything in the same syntax.
Scala is a programming language with more features than Java that is capable of running on the JVM (with a few features that can't be implemented on the JVM inevitably are disabled).
Quote:
It's not. It may have been when I started but I'm far past choosing a language at this stage.
Heh. See above and be master exploder'd.
-
Re: I bring thee not simple rearrangements, but a whole new world of possibilities,,,
And back on topic...
After quite a bit of debugging I've gotten the scripting engine running with basic functions.
Test Script:
Code:
(var boolean test_boolean false)
(var boolean test_boolean2 true)
(var int test_int 1)
(var int test_int2 125)
(var int test_int3 -10020)
(script all dormant "test"
(if test_boolean
(begin
(log "test boolean is true")
)
(begin
(log "test boolean is false")
)
)
(if (== test_int2 125)
(begin
(log "equals")
)
(begin
(log "not equals")
)
)
(log (<= 1 4))
)
Interpreter output:
Code:
- (script all dormant "test" <4> <10> <12> )
-- Call:If ID#4 Src: (if <-1> <1> <3>)
--- Call:Variable ID#-1 Src: test_boolean
--- Call:Begin ID#1 Src: (begin <0>)
---- Call:Log ID#0 Src: (log <-1>)
----- Call:Constant ID#-1 Src: test boolean is true
--- Call:Begin ID#3 Src: (begin <2>)
---- Call:Log ID#2 Src: (log <-1>)
----- Call:Constant ID#-1 Src: test boolean is false
-- Call:If ID#10 Src: (if <5> <7> <9>)
--- Call:Equals ID#5 Src: (== <-1> <-2>)
---- Call:Variable ID#-1 Src: test_int2
---- Call:Constant ID#-2 Src: 125
--- Call:Begin ID#7 Src: (begin <6>)
---- Call:Log ID#6 Src: (log <-1>)
----- Call:Constant ID#-1 Src: equals
--- Call:Begin ID#9 Src: (begin <8>)
---- Call:Log ID#8 Src: (log <-1>)
----- Call:Constant ID#-1 Src: not equals
-- Call:Log ID#12 Src: (log <11>)
--- Call:Lequal ID#11 Src: (<= <-1> <-2>)
---- Call:Constant ID#-1 Src: 1
---- Call:Constant ID#-2 Src: 4
And when I enter wake test into the console I get this in the log:
Code:
test boolean is false
equals
true
If you'll notice the interpreter output is quite informative now :iamafag:
And if you look closely you might find some built in casting. Mmmmmm girllllll. Look at that casting.
Writing custom functions is pretty easy to do. Though writing functions that stop the scripting language is a bit complex. (stuff like sleep and begin). I learned a lot about interpreting code like this though so next time it'll be better :downs:
In the end it's all functional so yay.
What kind of functions would you guys like to see. Stuff you wish halo had basically.
edit-
@Skyline:
Scala isn't any faster than java from what I've read. It's also not as widely used as java. I don't see any reason to switch unless I run into some major problem that I can't do with java (spoilers: I won't).
-
Re: I bring thee not simple rearrangements, but a whole new world of possibilities,,,
Since you are emulating halo script, maybe some details on how it works internally would be useful.
The hs runtime has its own "hs threads" (which are not actual system threads). Eg, a startup script would spawn its own hs_thread, a continuous script would run in its own hs_thread, the console has its own hs_thread, globals are initialized in their own hs_thread, etc.
Like system threads, each hs_thread has its own stack memory. Bit of trivia: Kirby was a jerk and made a heavily nested script for a CMT feature which exceeded the stack memory of an hs_thread, causing it to overflow into another hs_thread (and thus crashing). Were the community to have access to actual debug/tag builds of the runtime, there would be errors explaining this overflow. Instead, I had to debug this nonsense, which wasn't immediately obvious (and I wasn't involved with CMT's scripts). The stack memory contains stack frames (essentially an IP and a few other useful values) plus arguments to hs functions.
Anyway, for sleep they set a field to be 'current-game-time + sleep-time', and when the hs_runtime updates it checks that if the current game time to be sure if it can evaluate the hs_thread yet.
Also, 343i no longer uses the a LISP-esque syntax for halo script. Eg,
IDK if this was work that Bungie had initially started, or if it was something 343i sparked. Either way, they changed a lot of the underlying implementation of the script system (for the better AFAICT)
-
Re: I bring thee not simple rearrangements, but a whole new world of possibilities,,,
Quote:
Scala isn't any faster than java from what I've read.
It is using the JVM should have made that clear as day.
Quote:
It's also not as widely used as java.
Java was the most used language at some point for a year or two, forget the website with the statistics, though still not really a valid reason for justification. If you are building a multi-threaded database that runs on several servers, you wouldn't want to use C for that. If you are using lock-free algorithms, some problems occur such as the ABA problem that can be solved using a garbage collector that would otherwise be difficult in C. If I recall correctly C is the current most used language, but just because it is doesn't mean you should choose it for said purposes.
Quote:
I don't see any reason to switch unless I run into some major problem that I can't do with java (spoilers: I won't).
Well I guess you can't miss something you never had.
-
Re: I bring thee not simple rearrangements, but a whole new world of possibilities,,,
I think we're a little bit past the language discussion dude. I appreciate the information as a programmer myself, but Inferno has made it clear he's sticking to Java for this.
-
Re: I bring thee not simple rearrangements, but a whole new world of possibilities,,,
Quote:
Originally Posted by
Not Inferno
And back on topic...
What kind of functions would you guys like to see. Stuff you wish halo had basically.
Sync AI pl0x.
-
Re: I bring thee not simple rearrangements, but a whole new world of possibilities,,,
Quote:
Originally Posted by
NneYaTano
Sync AI pl0x.
It'll sync without any kind of scripting help. The entire engine is designed around multiplayer so unless you tell an object not to sync it will.
Quote:
Originally Posted by
Kornman00
Since you are emulating halo script, maybe some details on how it works internally would be useful.
The hs runtime has its own "
hs threads" (which are not actual system threads). Eg, a startup script would spawn its own hs_thread, a continuous script would run in its own hs_thread, the console has its own hs_thread, globals are initialized in their own hs_thread, etc.
Like system threads, each hs_thread has its own stack memory. Bit of trivia: Kirby was a jerk and made a heavily nested script for a CMT feature which exceeded the stack memory of an hs_thread, causing it to overflow into another hs_thread (and thus crashing). Were the community to have access to actual debug/tag builds of the runtime, there would be errors explaining this overflow. Instead, I had to debug this nonsense, which wasn't immediately obvious (and I wasn't involved with CMT's scripts). The stack memory contains stack frames (essentially an IP and a few other useful values) plus arguments to hs functions.
Anyway, for sleep they set a field to be 'current-game-time + sleep-time', and when the hs_runtime updates it checks that if the current game time to be sure if it can evaluate the hs_thread yet.
Also, 343i no longer uses the a LISP-esque syntax for halo script. Eg,
IDK if this was work that Bungie had initially started, or if it was something 343i sparked. Either way, they changed a lot of the underlying implementation of the script system (for the better AFAICT)
I'm just using lisp syntax. The way my scripts work (in code) is nothing like halo I assume. I just like the lisp syntax over lua. That's just a preference thing.
It would take a fuck load of work to overload my scripts haha. I'd actually like to see someone do it.
Scripts are executed post gameplay tick. It's on my list of things to multi-thread though.
As of right now I have these functions coded in:
log
if
sleep
<
>
<=
>=
==
begin
I need a lot more than that but I don't really know where to begin with adding stuff. :P
-
Re: I bring thee not simple rearrangements, but a whole new world of possibilities,,,
Added some more functions:
spawn <tag path> <script id> <x> <y> <z> returns void
actor <script id> returns actorID
invoke <actorID> <function to invoke> <opt param0> <opt param1> <opt param2> etc... returns void
Spawn let's you spawn a actor by giving it's tag, the scripting name you want it to have and an x y z coord.
Actor let's you get an actor by it's script name. It returns the actor id.
Invoke lets you invoke a function on an actor in the world. Invoke functions are relative to the type of actor you are invoking on. All actors have basic invoke functions like "location" "rotation" "push" and "destroy". Bipeds have invoke functions like "jump" and "animation". Weapons have invoke functions like "ammo" and "fire".
Code I tested with to make sure everything was working.
Code:
(spawn "object/scenery/raichu.scenery" "Toasty" 0 0 0)
(sleep 120)
(invoke (actor "Toasty") location 0 0 -50)
(sleep 60)
(invoke (actor "Toasty") rotation 0 1.2 0)
(sleep 60)
(invoke (actor "Toasty") destroy)
(log "Toasty was a bitch")