Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - v6v

Pages: [1] 2 3 ... 34
Off-Topic / Re: Genetic Algo, Please help
« on: 2013-10-30, 09:56:10 PM »
The pages wouldn't load on this site, the sourceforge site wouldn't even load for me.
(I don't know what happens, it usually happens for the forum websites that I try to access)

I've eventually fixed it on my own :)

I'll try StackOverflow

Off-Topic / Genetic Algo, Please help
« on: 2013-10-26, 08:46:12 PM »
Wrong section: but it's the only section that I can see:

Does anyone see any issue with this code?

(This isn't my homework, by the way, it's something unrelated)

It's supposed to be generating a series of triangles similar to this article:

I know the American flag is complex, I've tried it with a solid color image and it works well (Nearly perfectly), but trying it with an image of the American Flag, Darth Vader, or even a photo of Adam Sandler makes the program fail to work.

Thanks, SGDK2 Community.

EDIT: I've seemed to have found the heart of the problem!

But I don't understand why it's a problem.

I want to get/set the DNAA for a particular Polygon instance using this.DNAA and this.child.DNAA, but for some reason, JavaScript sets every DNA member to the value that I say for every Polygon Instance in the Population array when I do so, why is JavaScript doing this? In my fight() function, whenever I set the DNAA value of this.DNAA, the browser console is telling me that for all objects in Population, their DNAA is also being set to my value automatically.

My main question: Why is it that whenever I try to set the value of this.DNAA, it just ends up setting the value of all of the DNA arrays for every Polygon Object in my Population Array, rather than just setting it for the Polygon Object I'm trying to reference with, "this". I can get all other members of my Polygon Instance with "this.v1" or "" but for "this.DNAA", it throws errors.

(DNAA is just an Array<Number> of size 3.. Once I can set the DNA for specific instances of Polygon, rather than using a shared DNA pool for all Polygons, I can end up with distinct colors, rather than a jumbled mess of all of the colors on the screen.)

I'm reading up and it says that JavaScript isn't good with instances, that there are only singletons in JavaScript. That's funny, because for every other member of my Polygon class, getting and setting instance-wise is working fine, but for DNA, it seems to be failing severely.

Another area that I can't understand is why my Array.splice method doesn't work as expected. It's removing certain Polygon instances that honestly, shouldn't be removed from my list. The underlying code is right, but the splicer is splicing the wrong objects from my collection.

Projects / Re: Project Galaxy Devlog
« on: 2013-10-23, 09:37:58 PM »
Thanks again Vincent:

Update I guess?

I don't  have any screenshots, but I've figured out a neat way to recreate the SNES MegaDrive magic of 2D distortion effects.

I've made a heat wave effect which looks wonderful on most devices (OpenGL 1.x) . It's something usually used in the underwater areas of games. The screen begins to shake as if there's a good amount of heat or wavy water flowing.

I've made some other interesting effects as well, as well as perfect verlet rope and a pixelation distortion effect.

For the most part now, my use of 3D is going to be limited, 2D can be a crowd-pleaser if used right.

Can anyone here think of any unusual hardware effects for games? Something that may have been used in the past for older games?

There's also a Windows 8 App that will be in the store soon using SGDK2, it's something smaller that I've been working on, unrelated to this. :D My mouse isn't working and the tablet is dead, so it's been on hold for a while.

You would have to code it from scratch, but you could use existing assets.

bluemonkmn: I didn't even think it were possible to run SGDK1 games on anything above Windows Vista! You have to run as admin!
(Thanks bluemonkmn! I'm going to scan the SGDK1 directories and replay some of the old classics that I've been longing to play for ages: Chameleon Man, Bots, etc ;-) )

hai: Your game runs well. You should definitely have it running on HTML5, it's small, so it would port well, and through HTML5 your audience would grow even larger.

Projects / Re: Project Galaxy Devlog
« on: 2013-09-26, 01:08:24 PM »
Ouch, sorry to hear that.  I back up my ongoing projects everyday to avoid that kind of thing. 

Thanks Vincent, I'll take the good with the bad: I have a new PC now which runs the game faster with my 8 month old backup and I'm a much better programmer now due to the classes I'm taking.

I'm glad to have this forum's support :)

On topic while being off topic, what exactly is your game about?

Projects / Re: Project Galaxy Devlog
« on: 2013-09-15, 01:15:37 PM »
Yay! My harddrive died.

I can't access my FTP server.

Whoo hoo for month old backups on Google Drive... *sigh*

SGDK2 isn't compatible with SGDK1

You would have to upgrade. It's worth it. You don't have to deal with NSIS scripts and can have everything compiled into a neat little executable. Or you could have it run directly in the browser.

It looks like it's looking for a path on your computer.. Hannahas? You should have all of your images and other form of assets in the same folder you're running the NSI script.
(It's been almost 6 years since I've last used SGDK1 so I'm foggy)

Try to include all of your files in the same folder, the folder where your Death Game exe is. I don't think that SGDK1 makes an effort to move everything to the same folder for you.

I'm trying to remember how I did timed events in SGDK1, there were a million ways and workarounds I found without scripting. Your way sounds neat, and you can adjust the timer by setting the distance of your sprite which follows it and the speed of that sprite. Decreasing inventory items also worked well, but I remember that inventory items would always show up top. (You could disable it, I can't remember)

Ultimately the simple way to do it would be to use a moving sprite moving toward a target, and 6 years ago that's probably how I would have done it as well..

Tell you what, if no other members respond to this thread, upload a video of your game to YouTube. We can't run it on our computers. I'll walk you through making it in SGDK2, timed events are much easier to perform in SGDK2.

Help, Errors, FAQ / Re: ReactToPush
« on: 2013-08-09, 12:47:35 PM »
Anyone else working on a SGDK2 HTML5 project, when counters reach their limit, they loop back to the min value in JavaScript.

Similar to the ModulateAlpha/Red/Blue/etc.

bluemonkmn, can you add this to the HTML5 datasheet?

This should explain some strange behaviors relating to counters.

EDIT: That doesn't seem to be it either...? I'm not sure what's going on.

Help, Errors, FAQ / Re: ReactToPush
« on: 2013-08-08, 10:43:09 PM »
Going to add this:

AddSpriteAtPlan is officially tested, and it says that lastCreatedSprite is undefined.

Should I change lastCreatedSprite to GeneralRules.lastCreatedSprite inside of the .js function?

General Discussion / Re: Windows 8
« on: 2013-08-01, 09:41:30 PM »
That's drastic..... HTML5 is wonderful. It sounded as if I wanted to completely change it out, but that would be a cop out move- there has to be a way to get things running well, and there is as I'm starting to find out. I appreciate your effort to continue SGDK2 support.

I'm getting a very mild performance difference by replacing Math.floor with ~~ in drawImage- the function called frequently in the code.

Math.floor is called often. Performance logging is telling me this.

Elapsed inclusive time fell from 45.10 to 44.29%.

EDIT: Elapsed inclusive time rose from 45.10% to 56% after replacing more occurrences of Math.floor in a later performance monitoring session.  >:(

Programming is fun... when it's predictable. Unpredictability should be left to another field.. don't you agree?

Why even attempt to try and crank out a few extra frames per second anyways...  ;) I'm not even sure what I'm doing.


Dropping inclusive time by removing unneeded layers, setting layers to size 1, 1 in tiles with a large tile.

SGDK2 is running at a reasonable FPS with a project using multiple layers (7) as a HTML5 Windows 8 app now.

General Discussion / Re: Windows 8
« on: 2013-07-31, 05:29:00 PM »
I'm not sure, I can't get Google Chrome running on my computer.

Did I answer your question in my above posts, bluemonkmn?

General Discussion / Re: Windows 8
« on: 2013-07-31, 07:53:56 AM »
Issues fixed in HTML5

Figured how to fix Framerate
Screen Resize without the scaling lines is possible using WinJS ViewBox, figured out how to use ViewBox.
ms-interpolation-mode is obsolete, it's forced to be "bicubic" regardless in all modern versions of IE.
Nearest-Neighbor is no longer possible in Windows 8 HTML5. But it isn't needed thanks to the ViewBox anyways.

Persisting issues with HTML5

HTML5 games still seem to run *stunted* in Firefox
Firefox isn't as forgiving on script errors (Not really an issue on SGDK2's part)
Opera and IE give relatively good performance compared to others.
I'm not sure why Firefox is being this way.

^These aren't too important to me specifically, but they may be to Firefox users.

General Discussion / Re: Windows 8
« on: 2013-07-30, 11:33:13 AM »
Well, I've been scrambling around stackoverflow to see if I can squeeze any small performance differences from any functions.

Minute differences for commonly used functions in my code.

I've written a neat little custom code object, calculate.js, that attempts to find fast ways to solve problems. But that's all I've done scripting wise.

To answer your question:

I would love to find out why it is exactly that my game performs so slowly under HTML5 using the Metro Interface, yet I can overclock (;-)) to about 40 FPS in any browser that isn't Firefox. The lag is terrible... I wonder, should I not attempt to embed everything into one single file? Or would SGDK2 still attempt to load everything at runtime. I'll look into my code.

I'm not sure why exactly it is that the code lags. I'm sure I can eventually get to the scaling issue using the ViewBox property Windows offers (Without butchering mouse input recognition by scaling). C# seemed appealing because it offered me a chance to set the resolution of the display device. HTML5 does not allow this.

The modulates could probably become supported using CSS wizardry, but even that wouldn't do anything necessarily for performance.... It would probably further cripple rendering time.

Code: [Select]
img {
image-rendering: optimizeSpeed;        
  image-rendering: -moz-crisp-edges;          /* Firefox                        */
  image-rendering: -o-crisp-edges;            /* Opera                          */
  image-rendering: -webkit-optimize-contrast; /* Chrome (and eventually Safari) */
  image-rendering: optimize-contrast;         /* CSS3 Proposed                  */
  -ms-interpolation-mode: nearest-neighbor;   /* IE8+                           */

This is something that I used to use in my style for my webpages. It increased rendering time by a factor of 1.5 (Self calculation?). It removes Anti Aliasing and allows graphics to be rendered with pixelated edges (Similar to the Nearest/Linear hotfix I mentioned in C#)

It sadly only transforms images rendered outside of <canvas> I'm trying to find a way to get this line of code running inside of <canvas> It might help just a little

Profilers are telling me that ExecuteRules is the most executed function in JavaScript. Does it execute even for sprites without any rules?

(Off Topic: There were quite a few developers who re-released games on Windows 8 with slightly changed graphics each time, Pizza Guy and Taco Man, it's interesting, someone profited 200 dollars from this)

EDIT: Come to think of it, it I can get the above snippet working, then I can manually scale up and down mouse input per device. Nearest would theoretically remove the scale lines.

Pages: [1] 2 3 ... 34