"What do you type here" = 000 in binary DScript
Printable View
"What do you type here" = 000 in binary DScript
Yeah. Its actually a neat side effect. If you type in something that shouldnt go there, itll spit out "nop", which does nothing. If you want to play with the compiler, here is a list of commands:
Labels are defined as usual ("label:"). Results of arithmetic and bitwise operations are stored in the first operand, example:Code:nop [no args]
mov var val or var
add var val or var
mul var val or var
sub var val or var
div var val or var
push var (use mov <var> <val>/push <var> to push a value)
pop var
popa [no args] (pops all values from the stack)
and var, val or var
or var val or var
xor var val or var
int val
cmp var val or var
jmp label
jnz label (jump if not zero)
jz label (jump if zero)
jl label (jump if less then)
jle label (jump if less then or equal to)
jg label (jump if greater then)
jge label (jump if greater then or equal to)
je label (jump if equal to)
jne label (jump if not equal to)
shl var val or var
shr var val or var
aa now equals 27.Code:mov aa 25
add aa 2
Variable names are a combination of two letters("aa", "ze", "cd" are all valid, while "abc", or "d2" are not). This is a speed issue. Here is a newer version of the compiler. It will saves the compiled code to a file. It takes the base source filename, takes off the extension, and puts ".dso" on the end. There is also a "Labels" window. You can double click on a label, and it will highlight the Label in the current window. Anyway, check you all later.
Z.
OK so once its compiled how does the code be executed ?
Well I think thats pretty darned nifty... once the game's engine and models, etc is done we can start adding refrences to the 3d engine, sprites, physics, units, etc. and start writing some scripts >=]
I'm guessing this is an ASM-variant? If so is this right:I'm a bit confused... is what i put corret?Code:mov var val or var - move something into it's memory (equals operator)
add var val or var -add
mul var val or var -multiply
sub var val or var -subtract
div var val or var -divide
push var (use mov <var> <val>/push <var> to push a value) - ????
pop var - ????
popa [no args] (pops all values from the stack)
and var, val or var - AND op
or var val or var - OR op
xor var val or var - XOR op
int val - rounds down
cmp var val or var
jmp label
jnz label (jump if not zero)
jz label (jump if zero)
jl label (jump if less then)
jle label (jump if less then or equal to)
jg label (jump if greater then)
jge label (jump if greater then or equal to)
je label (jump if equal to)
jne label (jump if not equal to)
shl var val or var - bit shift left
shr var val or var - bit shift right
Ok. I have a simple script up and running, that just prints out 0 - 25 using a loop. So, Id say thats pretty good for 2 days of work, no? =).
Z.
That's excellent ;). Well today is labour day, which means tomorrow I go back to school :(. That'll make it harder for me to get online, so I'll only be able to see you guys between about 4 and 10.... (GMT-5), anyways...
I've written a home-grown MP3 decoder, and right now I'm working on a MIDI decoder, its something to do for fun but hopefully we'll be able to incorporate it into ToW. I'm also doing MOD, and probably WAVE (PCM).
After this I'm trying a spot of AVI (or MPEG if that would suit us better) using codecs. That's so we can have full motion videos in ToW ;).
And I'm also thinking of something else, that's resident-evil style cutscenes. I dont mean the videos, I mean the parts where it turns to 16:9 widescreen mode and you cant control the characters, a cheap scripted cutscene. This would allow the videos to be a lot smaller, at the sacrifice of quality.
Sounds good Sas. I was also thinking about doing in-game cutscenes, and then having perhaps two movies for each campaign, plus an opening and a closing movie. We can use DirectShow for those.
Z.
Oh, by the way, from a player's perspective, scripted cutscenes are far better then movies, as they kep the player in the game, instead of breaking them out of it.
Z.
Hello, every one! Long time, no see!
I've reinstalled my whle computer now, so it's kind of smooth :). We forgot to pay the phone bill this quarter, so I have been offline for a couple of days now. But I can see we're making progress! That's GOOD! :).
Sas, about the movies. You must'nt forget that we're not making Resident Evil. This is an RTS, not an RPG. You won't be able to see the characters close up. However, I think it would be rather awesome if we had a high quality video-clip somewhere between some of the missions. Whe you're watching a movie-clip, you usually use a lot more resources on the graphics than in the game because it won't affect gaming and stuff. So don't worry 'bout the resources, and about gamesize...don't wory about that either. They're not THAT big. HOWEVER, the only thing resisting us from getting movie-clips is me :p. It will take quite long to make it, you know...Besides, 3DS-MAX draws a HELL lott of resources. This is troublesome when making high-quality movies.
I'm gonna go to bed now, so sleep tight, everyone.
Ooops, I did'nt take the time to check the last posts. I agree with Zaei that if we make a couple of cut scenes for each campaign, maby 3 or 4 and make a lot of scripted ones in between, it'll be super. But we should definately have movie-clips.
I didn't for a second think we were making resident evil!!! Anyways, RE isn't the only game that has scripted cutscenes (though it's hilarious in RE when they talk, and make hand signals.... hehe) so I don't think you should be worried about that..!Quote:
You must'nt forget that we're not making Resident Evil. This is an RTS, not an RPG.
I also know that 3DSMAX will take a lot of resources, that's why I wont be asking you to do these in 3DS max. Just the high-quality models. Then we can boot up the ol' refrence rasteriser ={ (I know, but it's the best shot we have) or even better, Pov-Ray, and create a good movie. I think a better choice would be the D3D8, because it wont matter if we approximate light and we can use lightmaps (or if someone knows how, phong shading) to get a good speed increase with little quality loss from POV.
Also, we could add anti-aliasing which would be cool ;).
I believe that Phong shading is like vertex lighting, except that instead of each vertex getting a normal, each pixel gets one. Better lighting quality that way.
Um, I have been working on the scripting engine, and debugging the operands, and stuff, and it is coming along well. Next I am going to add pointers, and array access, then functions, then preprocessor stuff.
Z.
Gimme a Z! Gimme a ...
At the moment, the scripting language is about 6 times slower then C++. Thats DAMN good.
Z.
hey i cam work on the ai with yall i am really good with logic and that is all ai is just basicly program logic , right??? well if you need any type of logic help just ask
Zaei: Absolutely amazing how much work you put into this! It's...what can I say...? I just think the making of this project would have been impossible, or at least 40 times slower without you on the team! Every time I take a look at te posts you have something new up and it's faster and better every time!
Sas: Well, aboot the movies...I think I will be able to make at least some movies in 3DS MAX, I don't know. Let's just see. Nevertheless, I won't begin at it now.
BUT, Sas, have you made any progress on the music? I can't wait until I get my hands on some of it :)
I've tried but every tune I get is really really hard to get down on the computer.. and mostly it turns out to be a bit of other songs that slip into my sub-conscious.
Ekim: If you like, you can talk to Jorj in the ToW story thread, in this forum.
Here's me saying I cant make music ;)... Here's a sample from one i'm doing now
Great to know my work is appreciated =).
I havent gotten any work done today, yet, but i should =).
Z.
What did you think of the music?
Can you slur some of the notes together? It would pull it all together, instead of seeming like its just a collection of notes. Otherwise, I think its great!
Z.
I've made a new version but the slurring doesnt change the sound, really.
Well, I've got array access working. There are now two new operators:
The first allocates <rhs> amount of memory, and turns <lhs> into a pointer. The second sets the index into the memory allocated by "alloc". Example:Code:alloc var val or var
la var val or var
Everybody got that? =). Ill get some official documentation together sometime soon =).Code:alloc aa 5 //aa is now a pointer, with 5 bytes allocated.
la aa 0 // aa now points to aa[0]
mov aa 10 // aa[0] now equals 10
la aa 1 // aa now points to aa[1]
mov aa 20 // aa[1] now equals 20
push aa // push aa[1] onto the stack
int 0 // prints "20"
Z.
In a few days or so, I will create a quick app that uses the DScript DLL, and has a bunch of interrupts to use, and post it here, to let you guys try it out for yourselves. At the moment, we can define more than 65000 interrupts, which basically will give the scripting engine access to just about any (or every) function in the engine, or game. When i write the preprocessor, We will be able to define names of functions to be numbers to correct interrupts. Sound good?
Z.
PS, Earlier, I realized that 6 times slower than C++ is faster then VB >=).
The music was nice, but it reminded me somewhat of chinese music. And a bit of the 80's... I wondered if we could have something more like classical music with full orchestra and stash. I mean Timpanis, Strings, Flutes, Horn and everything. How 'bout it?
BTW, I was'nt able to load the midi into Cakewalk. Why, I don't know...It says:
The instruction at "0x6c3f5b1e" referenced memory at "0x00000011". The memory could not be "read"
To me it sounds like a sort of central Asian horn playing. It's good, though.
Ok, I have the DScript version of #define and #include done. Very simply:
The first just replaces itself with the contents of "somefile.dsf", the second replaces any (ANY!) instances of the first parameter with the second. This is good, and bad. It will make interrupts easier to use, but you could do "equ 1 2", also. So, Beware! =).Code:include somefile.dsf
...and...
equ hello 1
Z.
Im on fire today ::grins::. Functions are working now, and with them comes some more opcodes:
So, script framework should look like this:Code:function <identifier> //defines the function. Its really a label =)
call <function name>//calls the function, actually a jmp, but it pushes the current address
ret // returns from a function
end // end the script
We will be able to create a standard library of functions, so im pretty happy now =). More improvements to come. Stay tuned!Code:call main
end
function main
// stuff here
ret
Z.
PS. Beware. When inside of a function you MUST, MUST push and pop evenly. If the address that the previous function pushed is not on top when the interpreter sees a "ret", it will cause a crash.
Good Work Zaei :D
how are you making that compiler and scripting engine did you get an example on hwo to make one, or are you just interpation
Thanks, Psy.
Basically, Ekim, I am mimiking what the computer does with ASM.
Now, I need help here, guys. I need to know what else you want to see in this scripting language. So far we have basic arithmetic, arrays, engine interface, and functions, as well as some pre-processing. I am planning on adding some Fixed-point math, and improving the compiler interface. What else? Let me know, and ill see what I can do.
Z.
Oh i see, did you use a example to learn how to do it, or are you just good???? Your just good!!!!!!!!!!!!!
Just good =).
Guys, wake yer'selfs!
Z.
Zaei, I wonder. How many years have you spent doing all this stuff? How long did it take to learn all this?? I mean, you know more than I could ever imagine. I've played piano for like 12 years, and I consider myself good. But that's NOTHING compared to your skills on this!
As I typed in ToW Story thread, no internet SUCKS!!! Besides that, I'm ok.
As I typed in ToW Story thread, no internet SUCKS!!! Besides that, I'm ok. I've doing this without permission, ooops. The librarian hasn't noticed, yet... :D
Igor, Ive been doing VB for about 4, 4 and a half years, and C++ for about 11 months =).
Again, guys. What else do you want to see in the scripting engine? It's what you guys are going to be using, and I want to make it as easy as possible. Tomorrow perhaps, I will get that test app up and running. Give me a list of interrupts you want to use, and I will set them up for you.
Z.
I know what the interrupts are but I dont exactly know WHAT interupts there are to choose from, as right now we are a graphical engine and a scripting language ;). Also if I don't get this done very soon we'll use FMod. =)
And what does Push & Pop mean? Array functions or something like that?
Sas, Interrupts can be any function we want. There are over 65000 possible, and can be set. Since we have the pre-processor, We can just create a header file that has equ's for all of the interrupts.
Push, Pop, peek, and Popa are the stack operations. It is how you pass parameters to interrupt functions. Push places a value on the stack, pop takes one off, peek gets the top vaue without removing it, and popa removes all values. So, say for example, you have an interrupt that draws a line. You need a valid DC, 2 X values, and 2 Y values. So, the code would look like this:
Then, in the function, it will pop the dc, pop the first x val, pop the first y val, pop the second x, and the second y, then draw the line. Hopefully that explains it.Code:mov ax 0
mov ay 0
mov bx 100
mov by 100
int GetDC
pop dc
push by
push bx
push ay
push ax
push dc
int line
As for what intterupts you have to choose from, you tell me what you want, and Ill get it going for you.
Z.