Click here to Skip to main content
16,019,514 members

Comments by Member 14100511 (Top 6 by date)

Member 14100511 17-Mar-19 9:48am View    
Okay,
I'll leave the code as VB6. From what's been said it would seem that Microsoft in their infinite wisdom have stripped away the common sense from VB.

Instead of just doing the things I want, I have to do something else and then do a bunch of other stuff so I can get on and do the things I want to do, then do another bunch of stuff to effect my changes.
If this site has the equivalent of moderators, please delete my question and remove my membership.
Thank you.
Member 14100511 17-Mar-19 9:17am View    
Thanks for the reply Original Griff. Maciej Los - I have no idea what 5ed! is meant to mean.
So maybe I didn't write my qyestion well. My problem is *not* how to write an array to a file, it's how do I read a string of characters, then reset file pointer and read bytes, then reset file pointer an read an array of floats, read some more bytes, reset the file pointer and read another float array. Once I have managed that I will want to reset the pointer and rewrite the two float arrays, and if I'm going to have to figure out how to convert C#, (which I am not conversant with) to VB.NET, (which I am not conversant with) I can forsee that I will never complete the project.
Member 14100511 17-Jan-19 0:58am View    
Thanks raddevus. I should have said I'm working in VB6 as befits my age.
I don't see how the VB6 solution is going to return a signed value, but will give it a try.

Mostly my question is about where the sign bit is held in a little endian 4 byte number.
Member 14100511 3-Jan-19 5:47am View    
Thanks Maciej. That is really helpful. I shall read it thouroughly.
I have got there for now, by a probably very inefficient algorithm. I was overthinking things and confused by what I was seeing in-game as a result of my tinkerings. I've written a couple of short routines that will convert 4 bytes to long and back again, within the max/min constraints that the terrain interpreter puts on height. Now I can convert any one of the published terrain generators and push the output into the terrain map and see what I get.
Member 14100511 2-Jan-19 17:33pm View    
I'm not working in VBA to process images Maciej.
I'm working in VBA to produce a 513x513 array of numbers which I will insert into the game file which will then be read by the game engine. I'm just hoping someone out there knows how Unity/C# stores heightmap data.
It's 4 bytes, yes, and my first thought was it's a standard long integer, but in the game engine changes to the 1st byte seem insignificant, the 2nd byte minor, the 3rd byte noticeable but the 4th byte!
Values from 0 - &h39 and values above &h3f all result in a zero height in the game map, values in between seem to generate orders of magnitude of height change - and not simple powers of two.
My assumption has been that the data is stored in a standard MS format and it's just my lack of knowledge of MS coding platform internals that is holding me back, but maybe it isn't. I am perplexed.