Aller au contenu

Photo

Data Structures


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
Chuck91

Chuck91
  • Members
  • 4 messages
I've been looking around in existing DA scripts in the editor, and looking around the wiki... and I'm starting to suspect that the language is very limited and it is not even possible to implement new Data Structures known from general programming languages (like Trees), and there don't seem to be any predefined data structures except for arrays either.

Is that correct? Or is it possible in some way?

Earlier before I had the toolkit (which meant I couldn't post on these boards) I wrote a topic with some scripting related questions on thenexusforums here: http://forums.nexusm...ting-questions/

The answer I got to those questions was that pretty much all of the stuff described there should be possible... but as I'm looking around in the existing scripts I'm starting to suspect ever more that this is in fact not the case. Could anyone clarify please?

#2
Chuck91

Chuck91
  • Members
  • 4 messages
I'm not sure if bumping is allowed around here (couldn't find anything in the Site Rules about it), but since I already posted this almost 2 days ago and kind of want an answer asap, I'll give it a try :)

As you can see in the topic on nexusforums I linked in the OP, this is about my bachelor's thesis. I want to be able to tell my thesis supervisor as soon as possible whether this is gonna work or if I'm going for another topic, so that's why I'm looking for an answer asap.

#3
dr.drummie

dr.drummie
  • Members
  • 51 messages
hi!
dont know if this helps:
http://social.biowar...ipting_overview

look under strucutures..

#4
Chuck91

Chuck91
  • Members
  • 4 messages
I've already looked at all of that. I'm aware of structs.

My main concern is with Local Variables as they are described on the wiki. To me, it seems that it's impossible to save a bunch of data of unknown size on an object. Like, if I want to write a Tree data-structure (non-binary tree, so each node can have any number of children) and have an AI-controlled unit save a reference to that tree, and be able to grow the tree, obtain data from it at any time, etc., that seems to be impossible to me.

The impression I get from the wiki is that the only way to have objects save data is by pre-defining what data needs to be saved in a 2DA file, and I do not see how that would be possible to do with data structures which can dynamically grow/shrink during runtime.

#5
Sunjammer

Sunjammer
  • Members
  • 925 messages
It is possible to create dynamic data structures using effect variables (float, integer, object, string) but the way to do it isn't pretty.

An example of such an approach is Unlimited variable storage for all (http://social.biowar...m/project/1787/) which was created by BioWare's own Craig Graff. However over and above any performance issues there might be the approach he adopted might not be participially safe since, if memory serves, it uses the char_stage and companion mods often override the char_stage with a custom one. If a player installs or uninstalls the such a mod at the wrong time you could lose your stored data.

Edit:

Having looked at your other thread my advice would be that this is not the toolset you are looking for. DASCRIPT is a scripting language pure an simple. It does not support classes, inheritance, interfaces or any of the other OO features. It is single threaded and additionally has fixed limits on number of instructions, recursion depth, duration of an AI frame, etc. 


Have you considered something like Unity 3D?

Modifié par Sunjammer, 07 décembre 2013 - 05:36 .


#6
Chuck91

Chuck91
  • Members
  • 4 messages
Alright, thanks for confirming what I suspected :) Luckily a friend notified me recently when DA was on steam sale, so I got the PC version for only 7.50 (that is including Awakening), not the 30 euros I was thinking of when I wrote that topic on thenexusforums... so didn't cost me too much :)

Now that I've got it anyway, guess I can still play around with it in my free time... but indeed safer to switch to something else for something important which HAS to work out for my thesis.

I'll probably be going with Starcraft Brood Wars. There's a nice API (BWAPI) for C++ there, and lots of academic research has already been done using that, with many papers published... so I'll be sure that I have enough freedom there.

Thanks for the replies :)