N neilnapier Active Member Licensed User Longtime User Dec 9, 2007 #81 I didn't realise how popular this program would be when I released it... So far it has about 4 times as many posts as the others. The creator of the PC version did warm me of the slowness that may occur but it sounds god that you seem to have sound a fairly fast way. would it be possible to use the liquids with the pensizes and such and so be able to make it release the liquids in a more circular format first. (it is not spread out when created like in the PC version) Also these things don't need to be implemented straight away... As long as the basis of the game is created that is all that matters at the moment, then things like moddability, speed and other things will be implemented later.
I didn't realise how popular this program would be when I released it... So far it has about 4 times as many posts as the others. The creator of the PC version did warm me of the slowness that may occur but it sounds god that you seem to have sound a fairly fast way. would it be possible to use the liquids with the pensizes and such and so be able to make it release the liquids in a more circular format first. (it is not spread out when created like in the PC version) Also these things don't need to be implemented straight away... As long as the basis of the game is created that is all that matters at the moment, then things like moddability, speed and other things will be implemented later.
C colin9876 Active Member Licensed User Dec 9, 2007 #82 wider pen Easy to change the pens, do u mean like this? Ive just used Agrahams superfast library with a bigger pen footprint. U need to run this from the same folder with the bithandler.dll done for ttt Note to AGraham. I want to give Neil what Ive done so far so we can integrate it into his nice BS program, and require a change to the bithandler? Now I know u said u werent that keen on graphics, but I notice that uve only been off doing Maths (boring lol!) instead so ur talents would be appreciated here! need varible 'spread' sent to bithandler and px(i)=px(i) + rnd(-spread,spread) in the loop before the pixels are plotted. e.g. Spread might be say 0.6 so all pixels get num ranging from -.6 to +.6 added to px each move down 1) N.B. dont need any variation on y velocity just that change on px. 2) Im not sure how the random num generator works in C, does it just give u a num between 0 & 1? if so I guess it will be px(i)=px(i) +(RND-0.5)*2*spread or something like that. Im sure u know how to do it as u like Maths so much! If u can do it will u add it to the bigpenttt below, Ive changed the way boundry checking is done so its faster Last edited: Dec 10, 2007
wider pen Easy to change the pens, do u mean like this? Ive just used Agrahams superfast library with a bigger pen footprint. U need to run this from the same folder with the bithandler.dll done for ttt Note to AGraham. I want to give Neil what Ive done so far so we can integrate it into his nice BS program, and require a change to the bithandler? Now I know u said u werent that keen on graphics, but I notice that uve only been off doing Maths (boring lol!) instead so ur talents would be appreciated here! need varible 'spread' sent to bithandler and px(i)=px(i) + rnd(-spread,spread) in the loop before the pixels are plotted. e.g. Spread might be say 0.6 so all pixels get num ranging from -.6 to +.6 added to px each move down 1) N.B. dont need any variation on y velocity just that change on px. 2) Im not sure how the random num generator works in C, does it just give u a num between 0 & 1? if so I guess it will be px(i)=px(i) +(RND-0.5)*2*spread or something like that. Im sure u know how to do it as u like Maths so much! If u can do it will u add it to the bigpenttt below, Ive changed the way boundry checking is done so its faster
N neilnapier Active Member Licensed User Longtime User Dec 9, 2007 #83 Where is the BMP handler? I can't find it in the libraries? Hold on i read your post and i'll go try it out. EDIT: pretty fast but when I use blnDRAG = 1 thing tomake it draw it when the stylus is down and no when it was up, then it works on the computer but when on a PPC it waits untill you let go. Why is that? Last edited: Dec 9, 2007
Where is the BMP handler? I can't find it in the libraries? Hold on i read your post and i'll go try it out. EDIT: pretty fast but when I use blnDRAG = 1 thing tomake it draw it when the stylus is down and no when it was up, then it works on the computer but when on a PPC it waits untill you let go. Why is that?
C colin9876 Active Member Licensed User Dec 10, 2007 #84 Agraham Bitmaphandler.dll I actually tried to do the library change myself but no progress. I downloaded the microsoft free c# sdk, and the .net sdk (VisualStudio2003) but cant even get hello world to run yet. Its not user friendly. This just confirms my allegence to Basic4ppc! Just out of interest tho would Agraham post the c# from the bithandler.dll? Would be interested to see how u did it? Would still like the one line added if u will do it? Last edited: Dec 10, 2007
Agraham Bitmaphandler.dll I actually tried to do the library change myself but no progress. I downloaded the microsoft free c# sdk, and the .net sdk (VisualStudio2003) but cant even get hello world to run yet. Its not user friendly. This just confirms my allegence to Basic4ppc! Just out of interest tho would Agraham post the c# from the bithandler.dll? Would be interested to see how u did it? Would still like the one line added if u will do it?
agraham Expert Licensed User Longtime User Dec 10, 2007 #85 colin9876 said: Would be interested to see how u did it? Click to expand... Txt added as the forum will only upload certain type of files.
colin9876 said: Would be interested to see how u did it? Click to expand... Txt added as the forum will only upload certain type of files.
C colin9876 Active Member Licensed User Dec 10, 2007 #86 .Net library or C command Thanks - nasty stuff C language by the looks of it! whats the rnd function in C? I see .Net framework has double RandomNumber = RandomClass.NextDouble(); so extra line could be public int timer(int[]x, int[]y, int n, double spread) .. px(i)=px(i)+(2*RandomClass.NextDouble()-1)*spread Is it better to use the c# function for generating a random number or the .Net RandomClass function - or are they both the same thing? Last edited: Dec 10, 2007
.Net library or C command Thanks - nasty stuff C language by the looks of it! whats the rnd function in C? I see .Net framework has double RandomNumber = RandomClass.NextDouble(); so extra line could be public int timer(int[]x, int[]y, int n, double spread) .. px(i)=px(i)+(2*RandomClass.NextDouble()-1)*spread Is it better to use the c# function for generating a random number or the .Net RandomClass function - or are they both the same thing?
agraham Expert Licensed User Longtime User Dec 10, 2007 #87 colin9876 said: nasty stuff C language by the looks of it! Click to expand... Not all. It's beautifully elegant, very safe to code but just not what you are used to. BTW you keep typing C - this may be shorthand on your part but this is C# - which is different to C in many ways whats the rnd function in C? Click to expand... As this is C# not C there are no standard functions/libraries - it relies upon the .NET Framework. I see .Net framework has double RandomNumber = RandomClass.NextDouble(); Click to expand... That's the one (or one of several) More completely and with correct syntax. You need a new Random object to create the numbers and the C# compiler will complain that it can't convert a double to an int (because doubles are larger than ints so information can be lost) so you will need to cast it to an int yourself Code: Copy Random rand = new Random(); public int timer(int[]x, int[]y, int n, double spread) { ... x[i]=x[i]+(int)((2*rand.NextDouble()-1)*spread); ... } Here I've done it for you, with source. I haven't time to test it as I have lost the B4PPC test prog I used but as it got through the compiler it is probably OK. Attachments BitmapHandlerDll.zip BitmapHandlerDll.zip 2.4 KB · Views: 483
colin9876 said: nasty stuff C language by the looks of it! Click to expand... Not all. It's beautifully elegant, very safe to code but just not what you are used to. BTW you keep typing C - this may be shorthand on your part but this is C# - which is different to C in many ways whats the rnd function in C? Click to expand... As this is C# not C there are no standard functions/libraries - it relies upon the .NET Framework. I see .Net framework has double RandomNumber = RandomClass.NextDouble(); Click to expand... That's the one (or one of several) More completely and with correct syntax. You need a new Random object to create the numbers and the C# compiler will complain that it can't convert a double to an int (because doubles are larger than ints so information can be lost) so you will need to cast it to an int yourself Code: Copy Random rand = new Random(); public int timer(int[]x, int[]y, int n, double spread) { ... x[i]=x[i]+(int)((2*rand.NextDouble()-1)*spread); ... } Here I've done it for you, with source. I haven't time to test it as I have lost the B4PPC test prog I used but as it got through the compiler it is probably OK.
C colin9876 Active Member Licensed User Dec 10, 2007 #88 fab Looks much better! Thanks Agraham - Im sure Neil will think its a step in the right direction Attachments bstest.sbp bstest.sbp 714 bytes · Views: 512
N neilnapier Active Member Licensed User Longtime User Dec 10, 2007 #89 Much better, well done! I have altered it slightly so that the mousedown function is on but i'm not sure if it will work on PPC as I havene't tested it on it yet. All that I have done is add a few lines EDIT: Also has anyone noticed that sometimes when a stuck one falls then ir reappears at where it was stuck at and falls again. Is there any way to sort that? Attachments test2.sbp test2.sbp 869 bytes · Views: 526
Much better, well done! I have altered it slightly so that the mousedown function is on but i'm not sure if it will work on PPC as I havene't tested it on it yet. All that I have done is add a few lines EDIT: Also has anyone noticed that sometimes when a stuck one falls then ir reappears at where it was stuck at and falls again. Is there any way to sort that?
C colin9876 Active Member Licensed User Dec 10, 2007 #90 Neil, dont worry about the stray pixels, its just because I didnt clear a value - I will correct it As to ur changes - What did u hope to achieve? They dont make any difference on the PPC because you have to do a MouseDown before u can do a MouseMove. Are u wanting this program to run on the desktop aswell or is it soley aimed at the ppc? If it is just a ppc app I would say leave those lines out because all its doing is (fractionally) slowing it down? Last edited: Dec 10, 2007
Neil, dont worry about the stray pixels, its just because I didnt clear a value - I will correct it As to ur changes - What did u hope to achieve? They dont make any difference on the PPC because you have to do a MouseDown before u can do a MouseMove. Are u wanting this program to run on the desktop aswell or is it soley aimed at the ppc? If it is just a ppc app I would say leave those lines out because all its doing is (fractionally) slowing it down?
N neilnapier Active Member Licensed User Longtime User Dec 10, 2007 #91 What I was hoping to achieve was the ability to see the pixels as soon as you made it. I forgot that this would not be needed so yes you are right, it wouldn't be necissary. When I move the code and dlls to the original file it works apart from the fact that it is very very slow and flickers a lot. Do you knwo what i am doing wrong? Also where is it in that code where you set the colour? It used to use cYellow didn't it but now I can't find it? It also would be good to have it work on a computer but that is not the main priority so does not need to be worked on until a satble ppc version is released. EDIT: Oops... i get why it was taking so slow... I had made amistake in the timer. Attachments Open Source Code.sbp Open Source Code.sbp 6.8 KB · Views: 519 Last edited: Dec 10, 2007
What I was hoping to achieve was the ability to see the pixels as soon as you made it. I forgot that this would not be needed so yes you are right, it wouldn't be necissary. When I move the code and dlls to the original file it works apart from the fact that it is very very slow and flickers a lot. Do you knwo what i am doing wrong? Also where is it in that code where you set the colour? It used to use cYellow didn't it but now I can't find it? It also would be good to have it work on a computer but that is not the main priority so does not need to be worked on until a satble ppc version is released. EDIT: Oops... i get why it was taking so slow... I had made amistake in the timer.
C colin9876 Active Member Licensed User Dec 10, 2007 #92 Neil, Ive just seen how uve merged the two codes - not efficient because its doing all the processing for pensize, drawing lines etc in the loop thats moving the pixels. I'll merge the code, u work on the dll? do u have Visual C# 2008 compiler, Express edition is free from Microsoft, if not can u download it because then u can maintain the dll library? To get rid of those stray pixels I need an extra line in the C# routine If u can be the C# guy on this we wont have to keep asking Agraham to bail us out? Last edited: Dec 10, 2007
Neil, Ive just seen how uve merged the two codes - not efficient because its doing all the processing for pensize, drawing lines etc in the loop thats moving the pixels. I'll merge the code, u work on the dll? do u have Visual C# 2008 compiler, Express edition is free from Microsoft, if not can u download it because then u can maintain the dll library? To get rid of those stray pixels I need an extra line in the C# routine If u can be the C# guy on this we wont have to keep asking Agraham to bail us out?
N neilnapier Active Member Licensed User Longtime User Dec 10, 2007 #93 I could do it but I know no C# whatsoever. So as long as you give me code then I will do it. EDIT: I have Visual C++ 2005 Express edition... will that do?
I could do it but I know no C# whatsoever. So as long as you give me code then I will do it. EDIT: I have Visual C++ 2005 Express edition... will that do?
RandomCoder Well-Known Member Licensed User Longtime User Dec 10, 2007 #94 Neil, I was just checking out your open source code to see how your getting on but it's not possible without the images. Can you please upload the image file zipped or if you prefer PM me a copy so that I may take a look. Thanks, RandomCoder
Neil, I was just checking out your open source code to see how your getting on but it's not possible without the images. Can you please upload the image file zipped or if you prefer PM me a copy so that I may take a look. Thanks, RandomCoder
N neilnapier Active Member Licensed User Longtime User Dec 10, 2007 #95 OK here it is... just paste the img folder. It reads from inside the img folder in the program. Also I don't undertand all that stuff in the dll. There is like 30 folders in it!
OK here it is... just paste the img folder. It reads from inside the img folder in the program. Also I don't undertand all that stuff in the dll. There is like 30 folders in it!
agraham Expert Licensed User Longtime User Dec 10, 2007 #96 I've found time to look at this again. The previous dll versions were quick and dirty and the loop ends and indexing weren't quite right as I hadn't bothered too much, also it left pixels behind. Here's what should be a clean version with bounds limiting so it won't error and won't leave pixels behind. Note that there are changes in bstest.sbp. At pixel creation you were effectively indexing from base1 - it is now base 0 and your bounds checking is gone. Visual C++ 2005 Express edition might do for the desktop as I believe that you can create managed assemblies with it - but I have never used it. However none of the Express editions can compile for a device. You need Visual Studio or SharpDevelop for that or roll your own at the command line with the free Microsoft SDK.
I've found time to look at this again. The previous dll versions were quick and dirty and the loop ends and indexing weren't quite right as I hadn't bothered too much, also it left pixels behind. Here's what should be a clean version with bounds limiting so it won't error and won't leave pixels behind. Note that there are changes in bstest.sbp. At pixel creation you were effectively indexing from base1 - it is now base 0 and your bounds checking is gone. Visual C++ 2005 Express edition might do for the desktop as I believe that you can create managed assemblies with it - but I have never used it. However none of the Express editions can compile for a device. You need Visual Studio or SharpDevelop for that or roll your own at the command line with the free Microsoft SDK.
N neilnapier Active Member Licensed User Longtime User Dec 10, 2007 #97 That is amazingly fast!!! Well done. I wish I was of some help as it is my project but you guys are supreme compared to my simple knowledge of the language. Last edited: Dec 10, 2007
That is amazingly fast!!! Well done. I wish I was of some help as it is my project but you guys are supreme compared to my simple knowledge of the language.
C colin9876 Active Member Licensed User Dec 10, 2007 #98 Thanks again Neil - ur interface is nice, & ur an enthusiastic project manager! Free Expess edition - no dlls .. shame - I knew it was too good to be true! Last edited: Dec 10, 2007
Thanks again Neil - ur interface is nice, & ur an enthusiastic project manager! Free Expess edition - no dlls .. shame - I knew it was too good to be true!
agraham Expert Licensed User Longtime User Dec 10, 2007 #99 neilnapier said: Could you change it so that there is a variable in the code or in the dll so that you can change the colour of the pixels. Click to expand... Look at it closely Neil But its all or nothing I'm afraid. You could always pass the colours in as another array like in this version!
neilnapier said: Could you change it so that there is a variable in the code or in the dll so that you can change the colour of the pixels. Click to expand... Look at it closely Neil But its all or nothing I'm afraid. You could always pass the colours in as another array like in this version!
agraham Expert Licensed User Longtime User Dec 10, 2007 #100 colin9876 said: Free Expess edition - no dlls .. shame - I knew it was too good to be true! Click to expand... Dlls yes : so you could do libraries for Basic4PPC but only for the desktop.
colin9876 said: Free Expess edition - no dlls .. shame - I knew it was too good to be true! Click to expand... Dlls yes : so you could do libraries for Basic4PPC but only for the desktop.