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 - naltimari

#61
Quote from: skitzo on Thu 03/04/2008 22:24:30
Like I said above. Try checking out Raknet or python.

Thanks, I'll add RakNet to my stack.

Quote from: skitzo on Thu 03/04/2008 22:24:30
I don't know how complicated programming the code for 1 game to sync between 2 computers is...

Well, I never coded an online game, but I can tell you there are a LOT of issues to think of. For starters, you need to choose between a server-based game or a distributed p2p game. Each one has their share of problems.

Quote from: skitzo on Thu 03/04/2008 22:24:30
The thing I would worry about implementing into the game first would be a wardrobe and character builder so everyone doesn't look the same online.

I dont want to sound too harsh, but if you are going to code an online game, your first worry should be if players can play/interact well, then consider how the avatars are going to look like, because this is relatively straightforward to do.

Quote from: skitzo on Thu 03/04/2008 22:24:30
Again I apologize for not having anything this useful to contribute about what you are asking  :(

It seems to me that you are in a very early stage of your game, so take your time.

Actually, your decisions right now should be based on where you want to start from. If you choose AGS, you get yourself an engine. If you choose Python, you've got, well, PyGame and Notepad.
#62
Quote from: skitzo on Thu 03/04/2008 19:15:52
It really depends on what you are looking for (Just search the board).

Sorry if I was not clear enough, actually I'm interested in what you may find related to implementing multiplayer/cooperative gaming INTO ags.

I already use AGS, and I'm already programming my game, I just don't know how I would make my game multiplayer/cooperative, whenever I want to do it. My game is singleplayer now, but in the future, I have plans to make it multiplayer/cooperative, and when that happens, it's going to be online.

I'm aware of the TCP/IP plugin, but that's a bit old and 'stalled', so if there's anything new/active, I would really like to know, and I guess the community would also benefit from the info.

[]s
#63
PlayVideo() should return some status code to indicate if it was successful or not. Currently, if the video can't be played (due to a missing codec) or is not found, the user sees a rather nasty message box:

Quote
Video playing error: File not found or
format not supported: .\Compiled\clip1.avi

I'd rather 'code around' the error than to let that message pass through the player.
#64
Maybe it's just me, but I really miss a 'for()' construction. It's such commonplace...

Compare this:

Code: ags

int i = 0;
while (i < 10) {
  a[i] = i;
  i++;
}


To this!

Code: ags

for (int i = 0; i < 10; i++)
  a[i] = i;


UPDATE: Array initialization is such a pain... i guess i've been dealing a lot with them lately, so I'm a little pissed off with while's. If only array initialization would accept assignment... ;)

Code: ags

String s[4] = {"This", "is", "an", "array"};
#65
Whether if [multiplayer/cooperative gaming] is valid or not, I'm interested in your findings, since one of the items in my to-do list is just searching for alternatives.

I would appreciate if you could post your findings here whenever you have the time, or PM me.

Good luck!
#66
Well, I guess it's a little late to bring this up, but I wonder why Direct3D was even considered for a new rendering engine, instead of OpenGL 2.0 which is multiplatform. Does it have anything to do with Allegro?
#67
You can surely use Kris' suggestion, it will work and it is very straightforward.

However, if you are willing to keep all your code inside the module, which personally I find very interesting, there's a way. You must check for IsKeyPressed(13) on your module's rep_ex(), since on_key_press() won't get called whenever a textbox is present (and Enabled).

Code: ags

// this is the rep_ex that is inside your module
function repeatedly_execute()
{
  if (yourGUI.Visible && IsKeyPressed(13)) {
    // ok, the user has pressed 'ENTER' while your GUI was being shown;
    // provided you have only one text box inside your GUI, this check is enough
    // otherwise, you still have other things to check...
    ...
  }
}


Personally, I dont like the way text boxes are implemented. There are some issues that really should be addressed soon:


  • If you place more than one text box inside a GUI, all of them receive the keyboard events at the same time; this is certainly not what you might expect, and you must write code to handle this case (there are modules that help, though, like this one by SSH);

  • The text box does not 'wrap' text, so you can't have much text inside it; I had to write (well, I am still writing) code to handle this, because in my game there is a 'logbook' in which the user can enter long texts; My solution is to write a whole new 'textbox' based on two ordinary labels: one for the text and another one, on top of it, for the cursor.
#68
In my modules, I check for GUI-related events:

Code: ags

function on_event(EventType event, int data)
{
  // check if user clicked inside myGui
  if (event == eEventGUIMouseUp && data == myGui.ID) {
    // check which control the user clicked onto
    GUIControl* ctrl = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
    if (ctrl != null) {
      // user clicked over 'ctrl'
    }
    else {
      // user clicked inside GUI, but not on a specific control
    }
  }
}


eEventGUIMouseUp is triggered when the mouse button is released. There's also eEventGUIMouseDown, which is triggered when the mouse button is pressed. I usually choose to respond to the click in MouseUp, so the user can 'cancel' the click if he releases the button outside of the control in which he clicked...

Hope this helps.
#69
Quote from: Le Woltaire on Sun 16/03/2008 22:53:39
- Is it possible to add optional walk to points for objects? It has already been asked. But I ask again.

Well, you can certainly do it via Custom Properties. Just define two variables, 'WalkToX' and 'WalkToY', both with a default value of -1, and put the following on your GlobalScript.asc (or on a separate module):

Code: ags

function on_mouse_click(MouseButton button)
{
  Object* obj = Object.GetAtScreenXY(mouse.x, mouse.y);
  if (obj != null && obj.GetProperty("WalkToX") >= 0 && obj.GetProperty("WalkToY") >= 0)
    player.Walk(obj.GetProperty("WalkToX"), obj.GetProperty("WalkToY"));
}


Quote from: Le Woltaire on Sun 16/03/2008 22:53:39
Could there be an additional character.asc and inventory.asc script, so that the GlobalScript.asc doesn't get messed up with all kind of character and inventory functions anymore and becomes more economic.

I support that. It's a good idea.

As if all those previous suggestions weren't enough, I have another one... ;) I think it would be very useful to draw directly on a sprite's alpha channel. If we could do it by 'fetching' a DrawingSurface out of a sprite's alpha channel, we could draw on it just like another surface. It would certainly be useful in situations where you must draw anti-aliased text.

My idea:

Code: ags

DynamicSprite* asprite = DynamicSprite.Create(320, 240, true);
DrawingSurface* alpha = aSprite.GetDrawingSurfaceForAlphaChannel();
alpha.DrawString(0,0,"Blablabla");
...


Another approach would be to copy a greyscale sprite directly onto another sprite's alpha channel, much like CopyTransparencyMask(), but instead of using the alpha channel of the source, it would use the rgb channels as alpha values on the destination. This way we could achieve the same effect, only requiring a temporary sprite.

Idea:

Code: ags

DynamicSprite* alpha_temp = DynamicSprite.Create(320, 240, false);
DrawingSurface* alpha_surf = alpha_temp.GetDrawingSurface();
alpha_surf.DrawString(10,10,"The quick brown fox jumped over the lazy dog");
alpha_surf.Release();

DynamicSprite* texture = DynamicSprite.CreateFromScreenshot();
texture.CopySpriteAsTransparencyMask(alpha_temp);


The above code takes a screenshot of the screen and applies a 'mask' to it, formed by the string 'The quick brown fox...'. The source and destination should be the same size, I guess.
#70
Quote from: Pumaman on Tue 11/03/2008 20:00:39
Hmm, I'd forgotten that limit was there. Seems like you're the first person to need that many scripts ;)
I'll take a look at it.

Well, as a full-time programmer and part-time game developer ;), I tend to modularize my code as much as possible. I have modules that handle mouse movements, custom-made GUIs, dialogs, collectable items, a bunch of 3rd party modules, etc etc.

I could group a bunch of them together, but I guess modularization is the way to go, especially now that modules are so neat. :)
#71
Maybe I went a little far ahead on the modularization of my code, but today I got a 'Too many scripts in the game' message. I got 16 scripts, plus the GlobalScript. It's not that much... :)

I would love to see this limit raised to as high as 'unlimited'... ;)

Serioulsy, can we have a little more scripts? 32? Please?
#72
Quote from: subspark on Mon 10/03/2008 21:46:47
  • Users control an overall compression slider in order to tweak overall project size estimates
I dont know exactly what you mean, but if you want to use it as a 'target' filesize for the whole project, it would be a little hard to implement, so I would not ask for it... ;)

Also, I find that sliders would be a bit of an overkill, I guess a simple 'quality/compression' field would suffice. Any value other than 100 (for quality) or 0 (for compression) would trigger the compression of the sprite on the next game build.
#73
Quote from: Rui 'Trovatore' Pires on Mon 10/03/2008 20:35:15
You mean like the "Compress the sprite file" option in General Settings?

Actually I meant 'lossy' compression, like in JPG. Some sprites can surely afford lossy compression, as long as the engine keeps the original 'non-compressed' file (to avoid 'compression-over-compression' artifacts). This suggestion builds up on the previous one, in which sprites are fetched directly as files from a directory tree.

OTOH, I dont know what type of 'compression' is applied when you choose that option you mentioned, but certainly it's not as good as the compression present in PNG or JPG files, because the sprite cache grows many times larger that the original files.
#74
Quote from: subspark on Tue 04/03/2008 22:21:37
I can't say that I would be satisfied with the same method because my artists would end up waiting around for one another to finish committing their changes to the ever evolving 'acprset.spr' where as if the data was external to the editor, single sprites could be upgraded.

I totally agree, acprset.spr being so 'monolithic' is not a very good thing. I dont know how other engines handle sprites, but I imagine there could be a more 'dynamic' way, like you suggested (grabbing sprites from the filesystem instead of stacking them all together in one single file). That would be the first step towards distributing work across many people.

Maybe CJ can add some event to the editor plugin API when AGS is about to save/read sprites, thus the 'sprite monolith' scheme can be customized in some way.

I also think that acprset.spr is quite big, obviously because it is using some 'lossless' method to store all the sprites, but there are situations when some of the sprites certainly can be compressed, especially in higher resolutions that depict 'real' scenes. Hmmm, another plugin idea comes to my mind... ;)

Quote from: subspark on Tue 04/03/2008 22:21:37
So again to sum up my suggestion, I would really love to see AGS become more compatible with 'diffing' and 'merging' data in a way that feels personal.

My hope is for AGS to have a (ever increasing) flexible API, so people [who are willing to spend the time/money/effort] can customize it to their specific needs, by means of runtime and/or editor 'plugins'.
#75
Well, if you think it's worth the trouble, here's an idea:

Code: ags

struct yourstruct {
  char buffer[200];
  import function copyStringToBuffer(String s);
};

function yourstruct::copyStringToBuffer(String s)
{
  int i = 0;
  while (i < s.Length && i < 199) {
    this.buffer[i] = s.Chars[i];
    i++;
  }
  this.buffer[i] = 0; // put an 'end-of-string' in last char of the array
}


Then, in your code, you'll do:

Code: ags

String s = "my new style string";
structInstance.copyStringToBuffer(s);


Anyway, it's an approach like StrCopy, with the difference that you are going to use new-style strings, and can check 'enforce new-style strings' in the preferences...
#76
Have you tried to change 'char name[200]' for 'String name' inside your struct? Then the assignment will surely work.

If you dont want to change it, AFAIK there's no way to circumvent StrCopy, because you can not assign a new-style String to a char array without copying every single position (which is what StrCopy does).
#77
Quote from: Lt. Smash on Thu 06/03/2008 13:37:58
The suggestion is that all compiling errors are listed at once so you can solve them all

Depending on the way the parser is implemented (e.g. top-down, bottom-up, recursive), a single error 'cascades' into a lot of subsequent 'errors' which actually dont exist. This happens even in big mainstream compilers, like gcc or bcc (Borland), I mean, they may even report more than one error, but the only one you can 'trust' is the first. It's not that simple, I wrote a parser once... :)

While we're at it, I came across a parsing engine the other day which is very interesting, named Ch. ImageMagick has a binding for it. The best part I guess is that Ch would be compatible with the current parser (thus not breaking current scripts), since the syntax is also based on C.

Maybe AGS 3.1 could substitute the current parser for Ch?
#78
Quote from: dkh on Wed 05/03/2008 19:38:36
(1) Walkable areas (say, up to 32) can still be implemented the same way they are now...
(2) Programmers can access these areas in script (via accessing a DynamicSprite/DrawingSurface) and use that to change them in all ways...
(3) Programmers could also add new walkable areas, but they wouldn't have to use raw geometry functions (DrawLine, DrawRect or similar), they could load an image from the hard-drive or from the AGS sprite manager (via the sprite-slot) and use that one as a new area...

I agree with these suggestions. I think programmers must always have 'backdoors' for anything that can be done 'interactively' in the editor. This way, missing functionality can always be implemented by someone as an editor plugin.

Additionally, I would like GetWalkableAreaAt() to use Room coordinates, not Screen coordinates, as it is right now. If someone can point me to a hack that shows if a point is inside an off-screen walkable area, I would like to know (right now I'm using regions).
#79
Quote from: subspark on Tue 04/03/2008 13:35:09
I would really love to see an enhanced file manager that enables the author to create custom data libraries instead of compiling most of the game data into the executable.

Very interesting ideas, and it's very good to find these kind of concerns in the forum. They reflect the fact that (1) modern games should be (actually, must be) updated after their initial release and (2) games usually aren't made by a single person, at least not anymore.

I'm all for it.

Quote from: subspark on Tue 04/03/2008 13:35:09
[1] The author could release their game on a digital distribution system like Steam and provide updates to their players that don't require them to redownload the entire game exe. You would essentially diff the data libraries.

Or you would 'diff' the whole package, (game+data), and distribute only the 'patch' for winsetup.exe to 'apply' to the game. I dont know how Steam works, but I assume it's not free, so not everyone would be interested.

Quote from: subspark on Tue 04/03/2008 13:35:09
[2] The author has more control over how their game data is distributed and can better manage projects where multiple people are involved. An SVN repository could be created, for example, and daily builds could be done with the latest file revisions that are checked in by fellow team members throughout the day.

SVN integration could be implemented as an editor plugin, I guess. It's a very good idea. I was looking for a version control solution the other day, and SVN is coming out on top, along darcs (which I haven't evaluated thoroughly).

Daily builds would be very easy, I guess, since Game.agf is an XML file, and keeps the paths to every single resource in the game (sprites, sounds, fonts, etc). So, implementing daily builds would be a matter of (a) calling the editor with the 'compile' command switch, and (b) letting it update the resources to which Game.agf points to. (a) is already present in AGS, I dont know about (b).
#80
Quote from: SupSuper on Mon 03/03/2008 17:16:42
Well they're .NET Framework errors

Yes, I know that.

Quote from: SupSuper on Mon 03/03/2008 17:16:42
Not every developer is english. :)

I'm aware of that too, and btw I'm brazilian, nevertheless I stand by my argument. To me, it's very strange to use the whole framework in english (function names, classes, etc), and then receiving error messages in a different (localized) language.

There are certain 'keywords' that appear in error messages which help to debug or understand the problem, and when they are localized, you have to 'guess' or 'reverse translate' to discover what the error was really about.

Anyway, like I said, it's just a personal view, I didnt want to start a discussion. Unless CJ is considering localization of error messages... :) but i think he's not... ;)
SMF spam blocked by CleanTalk