Menu

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.

Show posts Menu

Messages - ollj

#41
i made the misttake to just assume that this, and things like this. would also work in version 3.4.0.5. without a null pointer on runtime, but they dont, leaving this to v 3.4.0.3 i guess. so, what went bad in 3.4.0.5, throwing null pointers on managed structs beiing read or written in in any other structs function?

possibly i initialized it wrongly? no, i tested my own minimal basic managed structs and very simple getter functions, and keep getting null pointers. maybe i am missing someting essential with managed structs?

stuff as simple as
Code: ags

managed struct Managedstruct{ 
int x;
}
struct containsmanagedstruct{
  Managedstruct value;
import ManagedstructGet();
}

void containsmanagedstruct::ManagedstructGet(){
  ms; ms= new Managedstruc;
  int i = this.Managedstruct.x; //gets me a null pointer
}

#42
The GUI."resize" tween pivots to the top left ot the GUI, and i assume thats the same for dynamicsprites...

having a function that somehow manages to set the scaling pivot, the point of the image that doesnt move when resizing, percentually with a float. That is whats missing for me.
#43
Quote from: Khris on Mon 13/07/2015 23:14:35
Somebody clearly declared variables in the header...

i (next to) never declare variables outside of structs. almost all of my variables are in various structures.
so i guess the same issue is with declaring an instance of a struct, and not exporting (and importing) that.
i didnt think about NOT declaring instances in scripts header (that also defines the instanced struct)
#44
v3.5.0.5 gives a pretty confusing error message on;

import int[] testfunction();

//---

int[] testfunction(){
  int Array[];
  Array=new int[2];
  return Array;
}

and the message is that it can not convert a dynamic array in a dynamic array of the same type.


-----

i have not figured out if there is any fast way to get the length of a dynamic array.
so far i always add ine integer, always being set to the array length of another dynamic array of the same struct. this i not too efficient.

-----

i have not figured out if there is any way to give any type of dynamic aray to any type of function as a function parameter. i assume there is none, except for having a dynamic array in the struct to directly paste to and have the function read this.DynamicArrayParameter from

-----


and i really want dynamic arrays to be able to be put inside of managed structs.
#45
AGS Engine & Editor Releases / Re: AGS 3.3.4
Mon 13/07/2015 11:26:27
It makes sense to move ProcessClick() to Room.ProcessClick() and GUI.ProcessClick()   ...

But removing the function from "global" in 3.4 as it is a global function in 3.3: http://www.adventuregamestudio.co.uk/wiki/Game_/_Global_functions#ProcessClick#
sure is not too user friendly, especially if it is still used in the famous "Two Click Handler" script, and otherwise an integral part of most applications.
and its not like the global ProcessClick() would be obsolete in 3.4, actually, now i may just have to rewrite this (as more or less equivalent container) function, not just for nostalgia but for functionality and backwards compatibility:


import void ProcessClick(int x, int y, CursorMode m);

void ProcessClick(x,y,m){
  Room.ProcessClick(x,y,m);
  GUI.ProcessClick(x,y,m);
}

It sure confused me that a function no longer exists, being moved to 2 other structs, and should at least be explained in the help file that come with the editor when you search for the (now decapitated) function, throwing a compile-error at you for no longer existing without telling you where it moved to.
#46
I have 2 different Structs, they contain (non-writeprotected) parameters/integers, getter and setter functions for them.
Now the second struct wants to access the value stored in one INSTANCE of the fist struct struct, that exists globally and that was instanced before the second struct is defined.

The second struct does that by not using "this." but instead directly addressing an instance of the first Struct (that exists before the second struct is defined). This however does create a new instance of that struct during runtime, and the addressed instance is NOT the same instance as the global instance of the first struct.
The instance referred to from the second Struct's function is instead a new instance that confusingly has the very same name/label in source code but (on runtime) has different memory addresses, without any warning about this during compilation. that second instance with the same label is of course  initialized with 0-vallues and null-pointers, and the (second) struct can use all its functions , change the values of the struct...

Intuitively you would think it would both point at the same single global instance of the struct.

Actually this can easily be confusing and make debugging unnecessarily complicated, since auto-complete does not care and no warning is given.

---

I tested this, and so far my only workaround to have one struct (and any of its instances) access the parameters/values/integers of another Struct- instances ... is to give Structs the ability to copy/load their data to a global array. I already made a struct for that (one for "int) and one for "Character*" (with v3.4alpha-dynamic array in the struct) and any other struct may "extend" on that struct to inherit the ability to copy its values to a global array, so that other Structs can read from it (and copy the data to their instances).
#47
Get a DynamicSprite* that is large enough for the text to be displayed.
get a DrawingSurfsce* on the dynamicsprite
draw text on it, there's a Drawingsurface. function for that.
make a copy of the drawingsurface with text on it on another drawingsurcace,  copyit 4x, each copy shifted by +-1 pixel in x or y
tint the copy in a different color. the copy will be your "outlined shadow"
then, if 1 px is not enough of an outline, dopy and shift more.
then put the source dwaringsurface on it, to have centered outlined text, on drawingsurfaces.

put drawingsurface text on dynamicsprite. make an object or views element point at the dynamicsprite.
#48
i may possibly miss a function or struct to do this:

- i want to create or remove characters via script (i think that's possible, but pointless if views are as static as i think they are)
- i want to create or remove a view via script, to be addressed similar to a DynamicSprite*
- i want to be able to add or remove an animation from a view via script.
- i want to be able to add or remove a frame from a view via script.

sadly a lot of view-parameters are read-only and so far i can only change the sprite of a views animations frame.

so, unless i am missing something, my resort is to make views that only have 1 frame and 1 animation, and to "repeatedly execute" 40 frames per second for each visible character, calculate and memorie in custom made structs, what sprite to load in that one frame.
i would like do do that, giving me more creative control over animating, and the maths and cases and array-pointers are not THAT complex, but is there not a better solution to change views via script to make them more dynamic?
#49
this was harder to find than it should be.

i would like to see the 30000k sprite limit to be gone:

made a loop that, for testing purposes, does this.dynamicarraypointer.create on a 40000 long array of DynamicSprite* pointers.
it has the strange side effect that on a completely different point an object-pointer becomes "invalid", unable to do anything with an instance of an object.
#50
Advanced Technical Forum / Re: 3D array
Wed 08/07/2015 15:48:49
the problem with pseudo-multidimensional arrays, and any strided list, is that it involves a lot of integer multiplications and divisions, and that's just inefficient.
#51
The Rumpus Room / Re: Teach me Trigonometry
Mon 06/07/2015 17:36:46
I prefer geometry over trigonometry, mostly because you just have to confuse the arcustangent with the arccosine once to be screwed up forever.
If i can solve something trigonometric with vectors, i prefer thinking in vectors!
It is just so much easier to visualize any problem with 3 pencils and a few right-angles than to deal with pi and complex numbers, at least intuitively to solve any abstract problem.

as far as geometry goes, whenever i need to remember a formula to calculate any intersection/distance/angle i just go here, the script is not in C, but the functions and math are pretty universal.


--a dregree in balooney--

when it comes to calculating angles, you just have to start thinking in radians as soon as possible and not even bother EVER to think in degrees.
degrees are just a confusing outdated notation, just think of them as 2 currencies, "degree" is like an ancient roman coin, and "radians" are like cryptocurrencies.

they are exactly the same as math are concerned, just with a different factor, and the exchange value is
0.017453292519943295769236907684886f RADIANT == 1 DEGREE
//which equals //
1 RADIANT == 57.295779513082320876798154814105f DEGREE

that conversion-rate between 2 scales, of whom the older dumber one (DEGREES) just used to work better with integers in base 60 (as it was used by ancient astronomers back then), matters just like knowing the speed of light and other universal constants matters.
using "degree" is like using inches to measure distance, just don't to it on the fundamental level of maths, especially when calculating angles in trigonometry!
you must only think in radians, because radians are so much easier in relation to Pi and imaginary numbers, you don't have to convert the values above if you only "trade in radians" and simply say "we do not accept your ancient degree-coins in my shop anymore".


--you will most likely only need only these 2 functions, often, so just eat them!---

getting that out of my system, i noticed that only 2 functions keep being important in trigonometry EVER (that can not be solved geometrically like i prfer to think about things)

https://en.wikipedia.org/wiki/Law_of_cosines (almost exclusively to use ArcCos to get an angle when you only know 2 lengths of a right triangle.)
and
https://en.wikipedia.org/wiki/Dot_product (almost exclusively to calculate distances of planes in 3d space with normal vectors)
and the 2 are closely related anyways.

you keep needing these to calculate with normal vectors and projections, which is done nonstop in any 3d projection, 3d rendering...

--- quaternion rotating in my grave---

the same applies with quaternions, whne it comes to rotations, that applies to  degrees (when it comes to angles that you rotate by (around an axis)), do NOT use Euler-notation for rotations, use quaternions-rotation instead. while you can concert the 2, its much more tricky than a simple conversion-factor (and yes, the very same factor is also included in it)

at one point you will realize that quaternions are a famous, useful and very complex thing, literally full of complex/imaginary numbers, VERY hard to truly understand its mathematical inner workings BUT easy to visualize and therefore easy to use (at least i think) with the abstraction below:

it doesn't even matter if you understand how the magic of quaternion rotation actually works, because the same function can always be computed with less and more accuracy/time/memory use, and thers always multiple different ways to do the same. you rarely calculate quaternion rotation with a pen and sheet of paper, its done by computers, and you just use simple functions that you dont need to know how they work, you just must know how to (NOT) use them!

think of quaternions as describing the position and rotation on a ship on the ocean.

the position of the ship is 2 coordinates on the sphere, latitude and longitude.
but the ship also has a looking-direction on the spheres surface.
imagine it is looking at another shop on the same sphere, that also has a position set by latitude and longiture.

there, you have 2 latitudes and longitudes to determine the position and viewing diredtion of a ship on the surface of a sphere.

quaternions are VERY much like that.

they do not "drid lock" like euler-rotations, and are easyer to deal with in computer code.

if all else fails when it comes to quaternion rotations, just thin in the https://en.wikipedia.org/wiki/Axis%E2%80%93angle_representation of a rotation. its as easiy as holdign a single pen and rotating it around its own main axis, to visualize a quaternion rotation in axis-angle representation. spinning the pen is like spinnign a ship on the tip of it, with the pens length being the diameter of the earth/ocean-surface.
#52
the idea alone to use lego minifigs and backgrounds for a point and click is nice enough to try.
#53
you can always use a binary-tree-case structure for speed.


int case;

if (case&4){//4

if (case&2){ //2 

if (case & 1){//1  //case==7
}else{//!1  //case==6
}

}else{//!2

if (case & 1){//1  //case==5
}else{//!1  //case==4
}

}

}else{//!4 

if (case&2){ //2

if (case & 1){//1  //case==3
}else{//!1  //case==2
}

}else{//!2 

if (case & 1){//1  //case==1
}else{//!1    //case==0
}

}

//and this structure can be doubled recursively, but its nearly impossible to find a missing { or } in a tree with >64 branches.
#54
there is no best resolution, just the peak of most famous aspect ratios.

its time to face that a 4:3 aspect ratio for home entertainment is just outdated. the 16:9 compromise, an average of the most famous aspect ratios, is just way too dominant by now.
#55
Any google image search on Walk cycle" or "pixel art" links to deviant-art a lot of times.
many people there may even offer commissions for pixel art, or make you a high-res flash puppet that animates in 8 directions that you can render in flash and do some low-res-outlining on. or find some free things to practice and modify.

something like
http://drud14.deviantart.com/art/My-Little-Pony-Flash-resource-kit-version-2-4-404815455
may turn into sprites like
http://panzi.github.io/Browser-Ponies/
#56
Quote from: Babar on Wed 15/04/2015 22:25:21
Huh...I thought I remember Yahtzee freely admitting to nabbing the music for the game from RPGMaker's music resources (with later ones done by m0ds?). I wonder who copied who :D.

yahzee just started "lets ego review" where he reviews and lets-plays his own games (sins of his youth). up until "krilbys notes" he just took any music from any collection, mostly rpgmaker. since then he got some custom made music.
#57
Game theory applies to strong AI as well as to preschoolers.
#58
I think you could relatively easily make this within ags, using dynamic sprites, the same forward kinematics, and a plugin that writes to bmp

think about the possibilities when your character sprites are build/changed within ags during run-time. it would be VERY easy to add hats and shoes.
#59
this will go well with my "conga dance animations"
#60
this module is good as canvas di draw lines, but not too efficient in interpolating bezier curves.

first i was like, wow, like it, save me some time.

then i looked into it, and was very confused why it is using algorithms/subroutines that use a lot of factorials and Math.pow().
while this may work faster for very high degree Bezier curves than other simpler Bezier-plotting methods, very high Bezier curves are pretty useless, because you switch to other curve representations to calculate/approximating a high degree curve, even with your used algorithm. instead of using a 20th Degree bezier curve, you simply use NURBS or Fourier interpolation for a '"curve with many turns". I am pretty sure fast-fourier-transform in 2 dimensions (like wolfram aplhas people-like-curves) beats your algorithm in accuracy and speed if you would like a "very curved curve drawn".

what i am getting at is that this modules way of drawing Bezier curves is likely not a good way for ags. instead a simple recursive iterative function that repeatedly interpolates between 2 points of a list of points, each time shortening the list by 1 point, is likely smaller and faster for most cases within ags.

see it as a challenge to make nurbs (non uniform bezier splines) curves or interpolated 2d-sinosoid-curves (using fourier analysis) in ags.
while "fast fourier transform" is not too efficient to draw interpolate splines|curves, graphic cards are designed to calculate these, and such ascript may be educational.
SMF spam blocked by CleanTalk