Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 05-17-2005, 02:01 AM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
Ah. Yea... They are 8 bits. I thought it was 4 bit before. :-/

I meant 'number'.
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #17  
Old 05-18-2005, 01:57 AM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
Quote:
Originally Posted by Velox Cruentus
Of course -- Digits take a lot less space then letters. It's pretty much known. Take this for example:

(-- binary, 2 bytes in length --)
5 (5) = 0000 0101
A (65) = 0100 0001

Now... Which one do you think has the least data to support? Plus they have to mention that the latter binary is a string. More calculations to make... Funness.
I am saying that I think the engine internally converts a numeric array to a string list if you try to store characters in the array, causing a drastic speed reduction

Of course that is just my speculation, and only Stefan can really say (*nudge*)
__________________

Reply With Quote
  #18  
Old 05-18-2005, 06:34 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Quote:
Originally Posted by Evil_Trunks
I am saying that I think the engine internally converts a numeric array to a string list if you try to store characters in the array, causing a drastic speed reduction
It is using floating point (64 bit) values, strings, lists or pointers depending on what variables you add to the array. A floating point value is only converted to string if you request it as string, e.g. if you output the value with echo/sendtonc.

Speed comparisons: String lists on serverside are really slow right now, although you need to use quite huge string lists to see a speed difference in the script. The string lists are more optimized on clientside. Also numeric arrays are much faster.
In new scripting engine it is using the same mechanism for normal numeric arrays and for string lists. They are probably slightly slower than numeric arrays (10-20%), but of course much faster than string lists. With Graal version 4 you also have the advantage that the script engine is coded in C/C++, so even numeric arrays should be faster than with v2.
Reply With Quote
  #19  
Old 05-23-2005, 03:17 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Bad code detected:
Initializing multi-dimensional arrays is done like this


arr = new[2][2][2]


You can also intiialize the subarrays manually e.g. to get different sized subarrays, but stuff like new[2,2] will not work
Reply With Quote
  #20  
Old 05-23-2005, 03:41 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Stefan
Bad code detected
Yeah, my bad. I've never ever used multidimensional arrays in C, so I forgot how the syntax worked. In my opinion, the [x,y] syntax makes more sense when the created array is a contiguous block of memory, but that doesn't really apply to Graal.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:01 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.