Aspect Weaver

This is a discussion on Aspect Weaver within the Other Technologies forums in category; Hi, Has anybody here attempted to use an aspect weaver (something like AspectJ) for game development? If yes, what were the results like? If no, is there any particular reason for your reluctancy? -Billy...

Go Back   Application Development Forum > Other Technologies

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 02-02-2005, 12:18 AM
Newbie Game Developer
Guest
 
Default Aspect Weaver

Hi,

Has anybody here attempted to use an aspect weaver (something like
AspectJ) for game development?

If yes, what were the results like?

If no, is there any particular reason for your reluctancy?

-Billy
Reply With Quote
  #2  
Old 02-02-2005, 09:47 AM
Phlip
Guest
 
Default Re: Aspect Weaver

Newbie Game Developer wrote:

> Has anybody here attempted to use an aspect weaver (something like
> AspectJ) for game development?
>
> If yes, what were the results like?
>
> If no, is there any particular reason for your reluctancy?


I can't figure out what AOP is, and the standard explanations won't help me.

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces


Reply With Quote
  #3  
Old 02-02-2005, 12:54 PM
Nathan Mates
Guest
 
Default Re: Aspect Weaver

In article <38a30913.0502012118.21c8e976@posting.google.com >,
Newbie Game Developer <bvcheung@gmail.com> wrote:
>Has anybody here attempted to use an aspect weaver (something like
>AspectJ) for game development?


I've never used that, personally. If the 'J' in 'AspectJ' stands
for Java, then the odds of professional game companies using it are
pretty much nil. Read archives of this newsgroup for more details, but
Java has been used in only a few commercial games. Mutations of Java
programming are therefore even less likely to be used.

>If yes, what were the results like?
>If no, is there any particular reason for your reluctancy?


Why should people have to justify not using somebody else's pet
paradigm? Those of us who have been programming for decades have heard
quite a lot of "silver bullets" over the years that'll make
programming EasyCheapFast-- and all three, not the usual pick two.
Most of those silver bullets have turned out to be duds, though
they've got 1-2 useful ideas that are better off without the cargo
cult mentality that surrounds them.

This newsgroup is still fighting off another NewParadigm cultist,
who's never developed a commercial game in his life. If you want a
better reception than him, I'd recommend actually finishing a
commercial game with this 'aspect weaving' methodology. And, probably,
get a less-weirdball name.

Nathan Mates
--
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein
Reply With Quote
  #4  
Old 02-03-2005, 01:49 AM
billvcheung@hotmail.com
Guest
 
Default Re: Aspect Weaver

Ok let me try and explain (although I have just seen it recently
myself):

Suppose we are developing an email system and an instant messaging (IM)
system. Now, as additional features/concerns/aspects we want all the
messages to be encrypted and signed (both email and IM).

Normally we would write something like this for our sending functions:

send_email(from, to, message)
.....m = encrypt(message)
.....m = sign(m, from)
.....e = make_email_sender()
.....e.send(to, m)
end

send_IM(from, message, IM_channel)
.....m = encrypt(message)
.....m = sign(m, from)
.....IM_channel.send(m)
end

Notice the code scattering for the encryption and the signing. This is
because the security "aspects" are "cross cutting" the sending
functionality for our emailing and instant messaging.

AOP followers claim that this is bad for the following reasons:
1. Almost identical code (encrypt and sign) is in 2 different places
2. The extra functionality is distractring from the core functionality
of the function (which is to send)

To solve this they suggest the following:

send_email(message, from, to)
.....e = make_email_sender()
.....e.send(to, message)
end

send_IM(message, from, to, IM_channel)
.....IM_channel.send(message)
end

secure_aspect
.....before send*
.....encrypt(m)
.....sign(m)
end

It's not really a new "paradigm" perse. It's just a really cool
preprocessor.

I think the interesting part is that it decouples* the clients (email
and im) from the server (security api). Procedural programming only
decouples the server from the clients.

*someone still needs to specify the weaving in the aspect though

I was wondering if perhaps anybody's tools group may have tried to
develop some sort of preprocessor that has similar functionality?

-b

Reply With Quote
  #5  
Old 02-03-2005, 09:54 AM
Phlip
Guest
 
Default Re: Aspect Weaver

billvcheung wrote:

> send_email(message, from, to)
> ....e = make_email_sender()
> ....e.send(to, message)
> end
>
> send_IM(message, from, to, IM_channel)
> ....IM_channel.send(message)
> end
>
> secure_aspect
> ....before send*
> ....encrypt(m)
> ....sign(m)
> end
>
> It's not really a new "paradigm" perse. It's just a really cool
> preprocessor.


I will continue to keep an eye on AOP, but that's just the "Execute Around
Pattern" from /Smalltalk Best Practice Patterns/.

But there I go about block closures again...

> I was wondering if perhaps anybody's tools group may have tried to
> develop some sort of preprocessor that has similar functionality?


Okay. Google for "Lua AOP". Whatever it is, someone could probably strap it
onto Lua...

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces


Reply With Quote
  #6  
Old 02-03-2005, 04:39 PM
billvcheung@hotmail.com
Guest
 
Default Re: Aspect Weaver

Thanks for the tips. I will take a look at Smalltalk and Lua.

Just curious:
I understand Lua is gaining popularity in game development. Exactly
what is it being used for? Does the Lua code actually ship in the final
product?

I was under the impression that C++ was used for everything.

-Billy

Reply With Quote
  #7  
Old 02-03-2005, 04:56 PM
Nathan Mates
Guest
 
Default Re: Aspect Weaver

In article <1107466750.686731.223820@g14g2000cwa.googlegroups .com>,
<billvcheung@hotmail.com> wrote:
>I understand Lua is gaining popularity in game development. Exactly
>what is it being used for? Does the Lua code actually ship in the final
>product?


In some cases, yes. Star Wars: Battlefront, which shipped some
months ago for PS2, XBox, and PC used Lua for the interface layer, and
some mission tuning parameters. Mercenaries, which just shipped for
PS2 and XBox, used Lua for mission scripting. (I work at Pandemic
Studios, on the SW:BF team, and the Mercs team is upstairs) I know the
Far Cry demo for PC shipped with a lot of Lua files for its UI, and
AI. World of Warcraft uses Lua for its UI as well, I've heard. I think
Amped (and sequel) for XBox used Lua, but I'm not 100% sure. See
http://www.lua.org for a partial list of titles using Lua.

>I was under the impression that C++ was used for everything.


Not so. If the benefits outweigh the drawbacks, we'll use it. I
speak from personal experience, being the one who pushed for Lua's use
on Battlefront, and implemented things. Please use caution when
listening to comments from 'Phlip', as he's pushing his own ideology,
and hasn't ever worked on a commercial game.

Nathan Mates
--
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein
Reply With Quote
  #8  
Old 02-03-2005, 07:46 PM
Phlip
Guest
 
Default Re: Aspect Weaver

billvcheung wrote:

> Thanks for the tips. I will take a look at Smalltalk and Lua.


I don't know of any Smalltalk used in professional games, but I ain't
been looking. Maybe you'l be the first!

The deal is that "execute around pattern" works where you have block
closures. C++ lets you simulate them, and Lua provides them.

> Just curious:
> I understand Lua is gaining popularity in game development. Exactly
> what is it being used for? Does the Lua code actually ship in the

final
> product?


Some games are an icing of Lua over a cake made of C++, middleware, and
art. Lua is good for the command-and-control layer due to slightly more
elegance than C++, including block closures.

Plenty of games running in your Xbox, Playstation, etc. have a little
Lua in there too. To put it another way, if you start investigating the
Lua community you will very soon find reports of use in games. They are
Lua's leading market.

> I was under the impression that C++ was used for everything.


I suspect the ideal is one should use C++ for efficiency, and scripts
such as XML and Lua for the things that change frequently.

--
Phlip

Reply With Quote
  #9  
Old 02-03-2005, 10:14 PM
Percival
Guest
 
Default Re: Aspect Weaver

On Thu, 03 Feb 2005 21:56:16 +0000, Nathan Mates wrote:

>>I was under the impression that C++ was used for everything.

>
> Not so. If the benefits outweigh the drawbacks, we'll use it. I
> speak from personal experience, being the one who pushed for Lua's use
> on Battlefront, and implemented things. Please use caution when
> listening to comments from 'Phlip', as he's pushing his own ideology,
> and hasn't ever worked on a commercial game.


I heard (well, read actually. I don't have first-hand exp) it depends on
the company. Some are C++ only, while others use Lua as scripting.

It is my assumption that there are more scripting languages used as well.

Percival

Reply With Quote
  #10  
Old 02-03-2005, 10:41 PM
Nathan Mates
Guest
 
Default Re: Aspect Weaver

In article <1107477976.994153.63790@o13g2000cwo.googlegroups. com>,
Phlip <phlip2005@gmail.com> wrote:
>I suspect the ideal is one should use C++ for efficiency, and scripts
>such as XML and Lua for the things that change frequently.


As I've said previously, I've personally (unlike Phlip) used Lua on
a commercial title. If anyone on my team suggested using XML, however,
it'd be like the scene in _Airplane_ with a line forming to slap some
sense into that person. XML is bloat, personified. Ascii file formats
do not belong on a console, PERIOD. Then again, (unlike Phlip), I've
got actual experience in this area.

Nathan Mates

--
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 01:01 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.