Author Topic: HUD/Python discussion  (Read 13717 times)

0 Members and 1 Guest are viewing this topic.

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Given the following operators

vector
takes three arguments, floating point - constructs a vector
syntax: ( vector x y z ), x y z being numerics or operators which return scalar numerics

3dcolor
takes four arguments, all floating point - constructs an RGBA color
syntax: ( 3dcolor R G B A )

draw-color-line takes three arguments -
One color argument, two vector arguments
Syntax: ( draw-color-line c v1 v2 )

now let's use these in an expression

Code: [Select]

  ( draw-color-line
           ( 3dcolor 1.0 0.0 0.0 1.0 )
           ( vector 10.0 10.0 1.0 )
           ( vector 20.0 20.0  1.0 )
    )

would draw a Red (zero transparecy) line from the coordinates (10.0, 10.0, 1.0) to (20.0, 20.0, 1.0)

we could also express this as a single-line

Code: [Select]

  ( draw-color-line ( 3dcolor 1.0 0.0 0.0 1.0 ) ( vector 10.0 10.0 1.0 ) ( vector 20.0 20.0  1.0 )  )
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Online taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Quote
Originally posted by Nuke
freespace memory usage has never bothered me. im dirt poor and if i can afford a gig of ram then anyone can :D.

Yes but we have multi platform issues to think about.  FS2_Open has slightly different memory requirements on the basic platforms since you have to take into account platform specific libs and ui stuff and input stuff and etc...

Also think about the fact that Python will likely use different amounts of memory on Linux than it might on Windows.  You can't assume that any memory stats you get under Windows are going to be the same on Linux and OS X.  A gig of ram my be enough for you but someone on OS X may have to get 2 gig.  Same for Linux.

Quote
Originally posted by Nuke
now that people have brought up the ui it gets me wondering, why are there two being implemented? i like the lab and all and its very useful for mod testing, but why is it and the other replacement ui not one in the same? not to complain, id like the idea of both the lab and the replacemnt interface. im just curious why theres two systems that do pretty much the same thing. is one just an interim solution while a more advanced system is being developed?

I don't consider the lab ui code to be suitable for the rest of the interface (but I am biased).  That's not to say that it can't do it, just that something written specifically for the FS2 interface ui would be better.  It would be nice if the two could be merged after I get done but that's something for WMC and myself to work out at a later date.  Of course what I'm working on isn't suited to the lab at all and deffinitely not for anything on the hud.  WMC's ui is great for that stuff and even possible future things that work in-mission such as billboards and various other things.

Having an interim solution would only make things worse.  It's wasted work since going from what we have now to what I'm working on is considerably easier than going from the lab ui code to what I'm working on.  I'm trying not the reinvent the wheel here.  As much code as possible will be reused and when I'm done the default interface will look and work exactly like it does now.  The difference will come when you get to do just about anything you want with it as far as customization goes.

Quote
Originally posted by StratComm
Taylor's comments do a good job of talking about the costs from a high level (though I'll admit he is a little close to the subject to be fully objective) and I hope he is heeded.

Very true, I'm not all that objective on this.  I have my point of view just like everyone else does.  I would much prefer to extend the SEXP system to do what's needed rather than introduce something new.  But I'm also coming from the "oh great, something new to worry about when there is a problem" side of things.  Everyone will probably agree that I'm the primary bug fixer so you can probably understand my concern there.  I'm not really a part of the modding, mission designing, model/art producing side of the community just so I can come from that other side.    That way I'm not obligated to come down on anyone's side on new features, just to keep it all working.


I think the basic developer thoughts (largely glorified for this posting) from the python discussion go something like this:

WMCoolmon: "Python!"
Bobboau: "More bugs!!"  (sorry Bobboau, couldn't resist ;))
Goober5000: "Why won't SEXP work?"
Kazan: "HELL NO!!!"
Taylor: "****.  Now I need another gig of ram. :sigh:"

:)

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Quote
Originally posted by aldo_14
I'm assuming you've already got a similar discussion in the scp internal, of course, so it'd be a cut & paste job.


Actually there isn't anything in there on this. It's only fair to have a technical discussion about this where other people can comment as this isn't just an issue about the coding in C.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Inquisitor

Quote
WMC infact linked me to a site showing python is 50x slower than C++ code


Of course it's slower, it's not compiled ahead of time, that's going to be true of any pure scripting system ;)

TGE Script gets around this (partially) by compiling the scripts the first time, then running the compiled scripts on subsequent runs.
No signature.

 

Offline Martinus

  • Aka Maeglamor
  • 210
    • Hard Light Productions
[color=66ff00]Given the realtime nature of games would a pre-compiled language not be a requirement nevermind an asset?
[/color]

 

Offline CaptJosh

  • 210
I'm sure someone will correct me if I'm wrong, but if I'm not mistaken, it's not the language that needs to be compiled, but rather the scripts written with it.
CaptJosh

There are only 10 kinds of people in the world;
those who understand binary and those who don't.

 

Offline Martinus

  • Aka Maeglamor
  • 210
    • Hard Light Productions
[color=66ff00]You've misinterpreted the meaning.
Scripts are not written with a language, they're written in a language or more to the point, in a language the compiler understands and can convert into machine code.
[/color]

 

Offline Inquisitor

Quote
Given the realtime nature of games would a pre-compiled language not be a requirement nevermind an asset?


Not for an actively developing game, and not for a game where you have non-coders contributing content, not to mention the ability to tweak and test instantly.

In my opinion, it's not an asset, it's a liability. Hinders development and content creation.

Imagine having to wait for a coder to compile a table (equivalent).

What you give up in execution speed, you make up for in flexibility.

But that's just my opinion. Monolith's engine (what used to be lithtech) had everything execute in C++, including game logic and levels.
No signature.

 

Offline Kamikaze

  • A Complacent Wind
  • 29
    • http://www.nodewar.com
A lot of the new posts say the same things about sexps's vs. scripting language. Let me stress again that sexps and a scripting language are not mutually exclusive at all. The scripting language can be used to create more extensions to the sexp system.

Python has been used in many intensive games successfully. A couple of examples are Earth and Beyond, Battlefield 2 and EvE Online (EvE uses stackless python). Other games have successfully used lua and other languages. It is definitely possible to use python or lua in FS2 without being too much of a burden on computers.
Science alone of all the subjects contains within itself the lesson of the danger of belief in the infallibility of the greatest teachers in the preceding generation . . .Learn from science that you must doubt the experts. As a matter of fact, I can also define science another way: Science is the belief in the ignorance of experts. - Richard Feynman

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
simply hooking python in will have overhead that writing new sexp functions and not using them will not
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
No one is saying that they are mutually exclusive. But a massive overhaul of the SEXP system automatically adds new SEXPs and allows you to create more.

Doing this in python simply gives you the latter. Why not get something for free?

I've yet to hear anyone state any disadvantages of doing this by simply expanding the pre-existing SEXP system.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
karajorma: it's not in the language some people prefer
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
I've actually yet to see any real advantage of reimplementing LISP from a half-arsed beginning (IE SEXP). I don't care if you use Python or not. Use Lua. Use Perl. Use Python. Use Vbscript. Use PHP. Use Java. Use ECMAscript. Use Rexx.

In short, use whatever gets you the most flexibility, with the least reinvention of the wheel. That points to a scripting layer to me. And Inqui's absolutely right: any scripting layer properly implemented would be modular enough to take any engine.

Quote
Originally posted by Kazan
karajorma: it's not in the language some people prefer

Ah, you mean like SEXPs? That seems to be your biggest aregument against scripting.  You prefer SEXPs. It cuts both ways.
[I am not really here. This post is entirely a figment of your imagination.]

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
mikhael: i prefer sexps for concrete computational reasons - performance is superior and overhead less than using a full scripting language
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline CaptJosh

  • 210
Kazan stated earlier that parsing text takes a lot of CPU cycles. I've seen that just in opening a large text document or a spreadsheet that I made from a highly expanded modded shiplist in Starfleet Command Orion Pirates.

FS2 Open is already preatty tough on system overhead, and you're talking about adding something that would just make it worse, mikhael. Not everyone has an uber-system. Personally, I'm running a Duron 1.6 GHz with half a gig of PC3200 DDR and an 8X AGP 128 MB geForce FX5200. Inferno already jitters pretty damn badly in some spots for me, and you want to add something that would make such an issue worse just by being there.

Contrary to your assertion, it's not a matter of the developers liking SEXPs more than a scripting language. It's a matter of at least some of the SCP developers actually taking into account that there are people like me without top-end systems.
CaptJosh

There are only 10 kinds of people in the world;
those who understand binary and those who don't.

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
/sigh

a spreadsheet/document in MS Word is not a good example
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Quote
Originally posted by mikhael
I've actually yet to see any real advantage of reimplementing LISP from a half-arsed beginning (IE SEXP). I don't care if you use Python or not. Use Lua. Use Perl. Use Python. Use Vbscript. Use PHP. Use Java. Use ECMAscript. Use Rexx.


And I've already posted an advantage. Any changes to the SEXP system are instantly useable by FREDders. It's a 2 for 1 deal.

And you still haven't posted a single disadvantage.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
I've said my bit. Do it or don't.
[I am not really here. This post is entirely a figment of your imagination.]

 

Offline CaptJosh

  • 210
Quote
Originally posted by Kazan
/sigh

a spreadsheet/document in MS Word is not a good example


You think I use that trash? OpenOffice, man. All the way. And I'm talking text files over a megabyte in size, which is unusually large for the average spreadsheet or text doc.

And would you kindly quit complaining when someone is backing you up? Take it in the spirit in which it is intended. I swear, you can't help some people... :rolleyes:
CaptJosh

There are only 10 kinds of people in the world;
those who understand binary and those who don't.

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Any office suite is still not a good computation example of what i'm talking about.


An argument "backing me up" that is totally off base is more damage than the opposition bro
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir